I deployed a program. some account interact with it and created PDA for the user state of the program.
After a while I upgraded the program because i need to modify the user state PDA, adding a new struct property.
Then, users that created the PDA before the program upgrade cannot successfully run any instruction that modify the PDA. This is the error:
Transaction simulation failed: Error processing Instruction 0: custom program error: 0xbbb
Program stakxxxxxx invoke [1]
Program log: Instruction: Claim
Program log: AnchorError caused by account: user_state. Error Code: AccountDidNotDeserialize. Error Number: 3003. Error Message: Failed to deserialize the account.
Program stakExxxxxxxx consumed 6957 of 600000 compute units
Program stakExxxxxxxx failed: custom program error: 0xbbb
*programId are censored
Any user that initiate new PDA and interact with the program are executing instruction smoothly, no error. I assume it was because the PDA structure is modified and the program cannot serialize old PDA properly anymore. My naive solution is that i need to update the old PDA data to have follow structure, but i cannot because only the program can update PDA. Is there a good way to save the old user so they can continue interact with the upgraded program?