Pre-upgrade and Post-upgrade
For a demonstration of the use of the preupgrade
and postupgrade
system functions, see the tokenized comments example.
NOTE
preupgrade
andpostupgrade
system functions may trap during execution and data may be lost in the process. Work is underway to improve canister upgrades by working with stable storage.