Hello,
I need to be able to update an application for iPad without deleting the sqlLite database in it.
I would greatly appreciate if someone could help me doing this.
Thank you.
sebastian [import]uid: 29594 topic_id: 9329 reply_id: 309329[/import]
I believe that if you copy, or create, the database in the systemDocuments folder then it should survive an app update which will only overwrite the contents of the systemResources folder.
Stefan [import]uid: 2646 topic_id: 9329 reply_id: 34073[/import]
I mean, I have installed an app on a iPad through XCode (not the app store), and this application has created an sqlLite db when first lunching and then stored a lot of data in it.
Now I would need to update that app (through Xcode), without losing the db created in the first place. Is this possible?
Thanks.
[import]uid: 29594 topic_id: 9329 reply_id: 34083[/import]
The update process is the same whether you’re manually updating the app or via the app store. Whatever is in the Resources folder gets overwritten by the update but if you copy any of the resources into the device Documents folder those files should still be there. You’ll have to copy your SQLite file in your code in order to achieve this. [import]uid: 2646 topic_id: 9329 reply_id: 34085[/import]
Thanks for your answers spjovwak. I’m just quiet newbie and there is something I must be missing.
The app I’ve created is already installed on the iPad. “Normaly” it should have saved data in its sqlLite db, and then sync those that with an external server. But it didn’t sync those data with the external server, and now I’m stuck with data inside my app (in the sqllite db) that I don’t know how to send outside the app.
So I thought about making some changes in Corona, build again and replace the app on the iPad, and here comes my question: is it going to also delete the original sqlLite db… ? I don’t know how to move the db to the Document folder at the first place.
Thanks a lot for your help.
seb [import]uid: 29594 topic_id: 9329 reply_id: 34097[/import]
Hi Seb
OK I understand your problem now. Unfortunately I don’t see anyway you could get your data out of the iPad once it’s part of the app. If you install a new version of the app now then it will overwrite all of the apps data on the device.
I guess if your iPad was jailbroken there are tools that allow you to see app files but I have no experience of that.
Stefan [import]uid: 2646 topic_id: 9329 reply_id: 34100[/import]
@sabee – he understood your question and he’s answered it correctly. If your DB is “writable” (meaning you can save data in it) and it has survived app restarts, then it is ALREADY in the docs directory and you can expect it to be there after an update…you don’t need to worry. Re-read the posts above again if you still don’t understand
I just saw Stefan’s new post and perhaps there is something I don’t understand? If you cannot ‘alter’ the existing DB to support the proper external “sync” functionality, you can query all of it’s data into Lua tables, then create a NEW DB file with the proper structures and write the data into that one [import]uid: 6175 topic_id: 9329 reply_id: 34101[/import]
Ok, I understand. Yes my db survives restarts so I should work, great! I’m going to give it a try.
Thanks for your help!
PS: Just so you understand the app I’m doing. It’s an app where the ORIGINAL data is taken with the iPad (through a web popup html form). So first, the form data is passed to my Corona app and kept inside my Lua tables, and then there is a button to send this data to a php server to save them in a MySQL db. [import]uid: 29594 topic_id: 9329 reply_id: 34103[/import]
My data is fine for multiple app launches… evertyhing is retained perfectly but not after an update. If my data in the Documents directory is supposed to survive an update then why is it being cleared each time I do a build and update my app onto my iPad using Xcode?
I have some real concerns about this becuase I anticipate that users will respond poorly to their historical data being purged when they get the newest version of the app.
Is the deletion of data when I build and update using Xcode unique to that process? Or am I doing something wrong?
Thanks in advance for any help or enlightenment!
[import]uid: 50537 topic_id: 9329 reply_id: 39093[/import]