I am working on an app and I am storing my data locally using SQLite 3. Now I will have updated versions of the same app in future and I will have to update the same using downloading and installing the new IPA file after removing it only.
But here the problem occurs. The client wants that the data stored locally in the prior version should be replaced in the newer version without using the web server.
I surfed several links and all results into negative response still I would like to know if there is any way with the help of which I can store my database outside application folder in such a way that even the removal of app does not affect the database and the newer version can fetch the data from the same database. Or any other way around? Thanks for response in advance.
You should store the database in the
Documentsfolder as all the content inside it remains there even if an app is updated via the app store (If you remove the app then this also gets deleted.. so keep this in mind )you can create a separate folder inside the
Documentsfolder namedDatabaseand store your file inside in.. you can create a path like this..EDIT:
Since you want to keep it even after the deletion of app, I don’t think you can do it on the device due to the sandboxing feature of the apps but you still you have one more option..
You can backup this database on your personal server and every time the app is installed it should query the server if a database for that particular user exists or not. If it exists than you can download and store it in documents directory else you give him a new database. You can perform this backup every once in a while or provide a sync option for the user himself. hoping this helps.