Canister snapshots as an intermediate migration mechanism

There’s been a fair amount of talk around canister migration, and I understand this feature is still a ways away.

However, now that we have canister snapshots, I’m curious if it might be simple/simpler to use those snapshots to migrate a canister’s wasm and state to a different canister on a different subnet.

Note: This intermediate solution would allow me to migrate the contents of the canister but to a different/new canister id. I understand the importance of keeping the canister id the same in other migration scenarios.

Say for example that I have a transaction history canister that keeps a record of all transactions. I want to migrate this canister to a different subnet for one of the following reasons:

  • I want this canister to now be on the same subnet as another canister to take advantage of reduced inter-canister latency or to use composite query calls.
  • The current subnet that it is on is experiencing latency and I wish to migrate to a less crowded subnet
  • The storage resource reservation cost mechanism has kicked in and I wish to migrate to a subnet with more available capacity.

Would restoring a canister from snapshot onto a different/new canister id, potentially on a different subnet be an easy or difficult engineering task to accomplish?

Ideally, then some of this work could then be reused for the full canister migration use case (preserving the canister id).

1 Like

Canister snapshots are cool ,particularly as a means to hedge against potential data loss during canister upgrade .
But i really don’s see them as a means to canister migration unless a change is made at that would allow for large data movement between subnets or perhaps subnet splitting

In order to use canister snapshots in the way you describe, you’d also need the ability to download the snapshot and then upload it again – which is also not possible right now. Alternatively, some other option on the protocol level that can move state around from one subnet to another but that could become more complex. In addition, as you already mentioned the ability to load a snapshot onto a different canister id would be needed.

The amount of work for the above is not too difficult necessarily but we do need to plan the resources for it, also based on the demand. Fwiw, an effort has been kickstarted internally to look into a possible design for canister migration so I imagine some of this would be covered there.