DB Structure changes and Backup

Here is a situation.
Supose we have key-value container as stable memory, say Hashmap<Int, {int, text}>.

But later on, I want to make changes in container strucuture, say Hashmap<int, {int, text, text}, in that case , what should i do ? Should I do manual migration of data from my previous container to this new container ? Or there is some other way also ?
Thanks in advance.

Iā€™m not aware of another approach.

Maybe you can use system func preupgrade() and postupgrade() by converting during canister upgrade

1 Like