During an app update via the App Store I want to update the SQLite database file with more content.
The old SQLite file is in the Documents folder of my app.
How do I handle this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m assuming you’re not using Core Data or else you’d be using the auto-migration feature. For straight SQLLite you’ll want to create a new database file. Then depending on the nature of your schema changes, you might be able to execute a query to copy the data over (
using INSERT INTO destination SELECT * FROM source) . But if the changes are too much to handle with a simple set of queries, for example if it involves business logic, then you might need to write a script to convert the old data from one database to the new one.