Core Data Update in the AppStore - iphone

I am just about to update one application from me. This app uses Core Data for saving the data, which the user puts in.
Now I want to fix some bugs, which aren't associated with Core Data at all.
What do I have to do that the User gets his data after downloading the Update?
I don't think about Lightweight Migration, because I haven't changed anything.
Do I have to add a new Model Versioning File? - I don't know.

You don't have to to anything. If the model and the data is not updated as part of the update, and you are storing the user's data in the documents directory, then a new version of your app will just carry on using the existing data.

If you haven't changed your Core Data schema at all, then you don't have to do anything. It'll still read the old data files with no problem.

Related

Maintaining Core Data in Future App Versions

I am currently creating an app that requires a large amount of user generated information to be stored in Core Data. When I release a new update of this app, I want to make sure that these users do not lose all of this data.
When I delete my current version from my iPhone, all of the Core Data disappears- will this happen when I create a new update version- does updating cause all of the Core Data to be deleted as the app is replaced? If so, what do I have to do to preserve the data?
I will not be changing my Core Data model between updates, if that changes anything...
Simple question - simple answer, the Core Data is backed up to iTunes/iCloud as part of the iPhone backup, and the users data is also persisted between updates.
You can optionally include the core data to be included in an iCloud sync, this means that even deleting the app and reinstalling it, the data will persist.
If you change your model, you are reasonable for mapping the old scheme to the new one, the data is then transferred via this mapping model when the new update occurs, the previous schemes data will get transferred into the new core data scheme.
Core Data versioning: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreDataVersioning/CoreDataVersioning.pdf
If there is your app in app-store Ver1.0. Updated Ver1.0.1 or higher, CoreData will be maintained. If Core data model changes, although all the previous core data will be maintained.
If there is your app in app-store Ver 1.0. deleting a Ver 1.0. Download it again or download the updated version of, CoreData will be deleted.
If you delete the app, core data will be deleted. To prevent this, using the iCloud synchronization data should work.
refer a following site, iOS How-To : Using Core Data with iCloud
must be you'll read a following Apple PDF: coredata model versioning and data migration programming guide

iOS - what is the right way to deal with a data model change?

I already have an app in the app store. I want to do an upgrade. My local data store has changed, with an extra table, and with a few fields added in the existing table. I want to retain the data in the old tables. How would I go about doing that? Could someone point me to tutorials that handle that kind of change?
Assuming you're using SQLite: Use a new database with a different name for your update. On startup, check for the table with the old name, copy the data you want, and delete it when you're done.
CoreData has it's own update data which may or may not work for you. You should look into how to change the data model.
Check out Apple's docs on migrating a core data instance. They make it super easy for 90% of the cases. The basic idea, is you break you xdatamodel into versions, so it has a path for migration
Here's a tutorial that might help you Core Data Migration

Core Data Model change app update

I would like to update my app, but I have completely changed the data structure, so is the Core Data model entirely different. Now, the data in the app does not have to be preserved, but you can't just update the app with this new model as it will crash.
What is the best way to update my app?
You need to version the core data structure. Use this guide
http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/CoreDataVersioning/Articles/Introduction.html
If you have a completely new data model you might look into having a new database persistent-store/db file and run a merge function if the app can find an old database.

Preserving core data after app update

I am using core data to store favorites chosen by the user. I would like to know that if I send an app update, how can I keep the data of the favorites preserved after the app is updated by the user?
I have read that you could use versioning, but I'm not sure if this the correct method.
Any help will be appreciated! Thanks
If your app maintains the same bundle identifier and you don't copy over the core data store file, you keep it.
If you changed your Core Data model, then you do need to worry about versioning. Depending on changes you may need to write rules for migrating data in the old store to the new format. As you have probably experienced, if you change data structure and do not migrate (or wipe existing data), you crash.

How to save Core Data after users update software?

As far as I know, the Core Data store is stored in the application's documents directory.
If the user updates the application through App Store, all the data will be removed, right?
Can I save data to another place?
Thanks
Actually, the data should be fine. However, you will have to perform a migration if you changed the data model in the new version of your app.