rakeshNS
rakeshNS

Reputation: 4257

Retaining data after updating application

I have some simple doubts. I have an application that store some important data in sqlite. Does the data I have kept in a Database would be removed after updating the application. I mean when a new version released and installed in iPhone. If it will remove, how can I keep data that persistant over all versions. Thanks in advance.

Upvotes: 2

Views: 294

Answers (1)

MobileOverlord
MobileOverlord

Reputation: 4610

As long as the database file is kept in the applications documents directory it will not be overwritten on application update. However, if the schema changes you will need to migrate your data from the previous data store to a new one and then move it into place.

From the iOS Programming Guide:

Files Saved During App Updates

When a user downloads an app update, iTunes installs the update in a new app directory. It then moves the user’s data files from the old installation over to the new app directory before deleting the old installation.

Files in the following directories are guaranteed to be preserved during the update process:

  • Application_Home/Documents
  • Application_Home/Library

Although files in other user directories may also be moved over, you should not rely on them being present after an update.

Found in this document.

Upvotes: 3

Related Questions