I would say yes. There is no specific way defined for this. I usually do this by backing up data in stable variable and then reassigning the values from back up data to original structures.
I am guessing you are using Motoko, and in that case you are stuck with pre-upgrade, and post-upgrade methods to ensure you keep the data.
Rust has two libraries that make you able to persist data without pre-and-post upgrade calls, but the learning curve to master Rust on the IC is much higher than the one for Motoko.
So, I have some good news for you that may be useful there is a library that can persist data even if you use Motoko, if you haven’t see it is called Motoko-Hash-Map by @ZhenyaUsenko:
Write a function that maps the old type to new and pass the data through this in postupgrade. Then remove this function for future upgrades since you wouldn’t need it again.