Update ionic app without loss of data?


#1

I am developing an app using ionic2 and Couchbase Lite (for offline data storage). After releasing the app, how can I update app without losing the user data?


#2

Do you have an answer for this question?
I have the same question


#3

Updating an app shouldn’t loose any data, ever.
What exactly are you doing so you are afraid of that?


#4

hi @Sujan12

thanks for your response.

In my mobile app all my data are stored in a backend webservice.
So there is no data directly stored on the mobile-device.

The only exception is the authentication token.
I store the token within the native storage to persist it.

My question now if I would update my app, would I loose the token?

If this would be the case, the user would start the app and redirected to the login page
to authenticate itself again.

If the token would be still available and valid within the native storage, the user
would be directly authenticated.

O.K the token has an expiry date, and if it’s expires, the user has to sign in either way again.

I hope my english skills are good enough, that you understand me.

regards,
Oliver


#5

No, your stored values should still be present. That’s what storage does :slight_smile:


#6

I don’t know how the magic on the device happens :slight_smile:
I read, that native storage is using sqLite to store the data on the device.

But so far I know is sqLite an embedded database right?
That means it’s included within the app.

How does this ‘magic’ work, when an app updates by the store, the storage keeps separeted and
so it’s not overwritten?

regards,
Oliver


#7

Database engine can be embedded to the app (code) but data (files) are stored in app storage.

E.g
/apps/yourapp - code here
/userdata/yourapp/ - data here


#8

In general (very simplified!) your “app” that was downloaded is never changed on the device. Everything that you create is saved in a different location.


#9

you will only run into issues if you change the unique name of the app (like the com. package name in Android as configured in config.xml)