Every time I bump to a new version of my Core Data Model, the SQLite database doesn't get filled with the previous versions data.
For example:
[MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:@"myapp 7"];
However, if I move back to "myapp 6", the users are all there still.
Is there a way to bump the model version and keep the data from SQLite?
Thanks
Core Data migration does not migrate the data to a new file, it updates the persistent store file in place. Your steps are correct except for #4-- because at that step you're telling Core Data to use a different persistent store file than the one you've been using. That's why the data is missing, because you're opening a different, new file. You're specifically telling Core Data to not use the existing file with previous data. If you want to update the persistent store to use the new model version, you need to use the same file name so that the existing data can be found and updated.
For what it's worth, there's no reason for the persistent store file name to match the model name. They can be the same, but if you include version numbers in the persistent store name then things can get confusing. Changing the persistent store name isn't normally part of model migration.
You can move data to a new file if you want, but this is not normally part of updating the data model.