The deprecated methods look like this, i’m using ic_cdk v0.11.0
pub fn deprecated_pre_upgrade<T: Serialize + CandidType + DeserializeOwned>(
data: &RefCell<ic_scalable_misc::models::original_data::Data<T>>,
) {
storage::stable_save((&*data.borrow(),)).unwrap();
}
pub fn deprecated_post_upgrade<T: Serialize + CandidType + DeserializeOwned>(
data: &RefCell<ic_scalable_misc::models::original_data::Data<T>>,
) {
let (old_store,): (ic_scalable_misc::models::original_data::Data<T>,) =
storage::stable_restore().unwrap();
*data.borrow_mut() = old_store;
}
and i did check that out, i had an other post about that here Migrate non-stable storage to stable storage on single canister
Do need to say that at that time the focus was to keep non-stable persistent so i wouldn’t loose it through upgrades.
But i will check it out again, see if i can spot something