#How to update data saved on local storage

8 messages · Page 1 of 1 (latest)

wraith turret
#

I save data on local storage, but I might change the structure of the data or how I use it, which might break the users that is keeping the old data structure in their local storage. What is the best way to handle this update of local data.

solar plinth
#

Show a dialog asking the user to backup their current data, just export the localstorage value as a file for backup and then just update the value, if anything goes wrong give them the option to restore

wraith turret
#

ok I am not doing any of that, how do I make this automatic smoothless and non intrusive

solar plinth
#

You can skip the backup and restore step

wraith turret
#

can you just write me an infrastructure for handling this step.

acoustic viper
#

you can version the data and write migrations

wraith turret
#

Oh good reference thanks for this.