4

I developed one database related application for iPhone device(SQlite database). Now i want to update that application with more features(I want to push an update for the same application).

Here i am more concerned about the user data while pushing the update so my question is if i will push an update then does the update will clear all the data that is stored in .sqlite file?

if this is case then how to push application update without modifying the previous data in the database file?

Please suggest.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Jim
  • 4,639
  • 5
  • 27
  • 31
  • In my case database structure is not going to modify at all. My concern is if user has entered some of the records in database file then while updating application how to preserve the previous records in database file? Hope this make sense. – Jim Mar 23 '10 at 06:49
  • It depends on where the database is saved, see my answer. – christo16 Mar 23 '10 at 06:54
  • This is a duplicate of this question: http://stackoverflow.com/questions/1223696/how-the-application-upgrade-works-in-iphone and possibly this one:http://stackoverflow.com/questions/941479/upgrading-iphone-application-via-itunes – Brad Larson Mar 23 '10 at 14:59

1 Answers1

5

AFAIK the documents directory is left in-tact on an update. If you stored the database in the documents directory then you should be okay. If it's in the app's bundle, I don't think there is much you can do save it.

christo16
  • 4,843
  • 5
  • 42
  • 53
  • Thanks for reply. So you mean to say initially when application runs first time then copy the database file from resource to Documents directory. after that load the database file from document directory and perform the operation on that file. Am i correct?? – Jim Mar 23 '10 at 06:56
  • Well, like I said it depends on where your app saves the database. If it's in the documents folder, then that if left in-tact during an update. If you stored it in the app's bundle, that is completely removed during an update (because your old binary is replaced by a new one). Not sure of a workaround for if you've stored it in the bundle :/ – christo16 Mar 23 '10 at 07:16
  • Thanks christo, I tried to store database in Documents directory and it worked as you said. Once again thanks for your help and quick responses. – Jim Mar 23 '10 at 08:33
  • Other thing that i want to clarify is does "Library" folder changes or remain as it is while updating application? – Jim Oct 08 '10 at 10:40