Going from setupCoreDataStackWithStoreNamed to setupCoreDataStackWithAutoMigratingSqliteStoreNamed #562

Closed
johnphan opened this Issue Sep 5, 2013 · 3 comments

Comments

Projects
None yet
4 participants
@johnphan

johnphan commented Sep 5, 2013

I have an app already submitted using setupCoreDataStackWithStoreNamed without xcdatamodeld versioned and now that I've learned about setupCoreDataStackWithAutoMigratingSqliteStoreNamed and created a new version of xcdatamodeld. I've checked the .sqlite store and it looks like it's still using the old model even if I point it to the new version of the model.

Can anyone help me with migrating from setupCoreDataStackWithStoreNamed to setupCoreDataStackWithAutoMigratingSqliteStoreNamed for a already submitted application without wiping the data?

Thanks,
John

@casademora

This comment has been minimized.

Show comment Hide comment
@casademora

casademora Sep 5, 2013

Member

Just use the new method. Everything else will still work the same

Sent from my iPad

On Sep 5, 2013, at 9:12 AM, johnphan notifications@github.com wrote:

I have an app already submitted using setupCoreDataStackWithStoreNamed and
now that I've learned about
setupCoreDataStackWithAutoMigratingSqliteStoreNamed; what are the steps to
fix that?


Reply to this email directly or view it on
GitHubhttps://github.com/magicalpanda/MagicalRecord/issues/562
.

Member

casademora commented Sep 5, 2013

Just use the new method. Everything else will still work the same

Sent from my iPad

On Sep 5, 2013, at 9:12 AM, johnphan notifications@github.com wrote:

I have an app already submitted using setupCoreDataStackWithStoreNamed and
now that I've learned about
setupCoreDataStackWithAutoMigratingSqliteStoreNamed; what are the steps to
fix that?


Reply to this email directly or view it on
GitHubhttps://github.com/magicalpanda/MagicalRecord/issues/562
.

@johnphan

This comment has been minimized.

Show comment Hide comment
@johnphan

johnphan Sep 5, 2013

Cool, thanks. I did some experiment that when an non-versioned model setup by setupCoreDataStackWithStoreNamed and than upgrade to setupCoreDataStackWithAutoMigratingSqliteStoreNamed, the data didn't migrate. But if I have version the non-versionmodel and run setupCoreDataStackWithAutoMigratingSqliteStoreNamed to setup, and than update the model based on that version, the data seem to migrate.

This is what I plan to do, submit another version of the app with the same model that is "versioned" using setupCoreDataStackWithAutoMigratingSqliteStoreNamed. The subsequent versions will migrate automagically. Tested in the simulator and device, hope it will perform the same in the app store.

Thanks.
John

johnphan commented Sep 5, 2013

Cool, thanks. I did some experiment that when an non-versioned model setup by setupCoreDataStackWithStoreNamed and than upgrade to setupCoreDataStackWithAutoMigratingSqliteStoreNamed, the data didn't migrate. But if I have version the non-versionmodel and run setupCoreDataStackWithAutoMigratingSqliteStoreNamed to setup, and than update the model based on that version, the data seem to migrate.

This is what I plan to do, submit another version of the app with the same model that is "versioned" using setupCoreDataStackWithAutoMigratingSqliteStoreNamed. The subsequent versions will migrate automagically. Tested in the simulator and device, hope it will perform the same in the app store.

Thanks.
John

@l4u

This comment has been minimized.

Show comment Hide comment
@l4u

l4u Jan 14, 2014

@johnphan
Do you mean these?
version 1: non-versioned model + setupCoreDataStackWithStoreNamed
version 2: non-versioned model + setupCoreDataStackWithAutoMigratingSqliteStoreNamed
version 3: versioned + setupCoreDataStackWithAutoMigratingSqliteStoreNamed

Thanks!!

Are there any other ways for migration when the store is set up with setupCoreDataStackWithStoreNamed ?

l4u commented Jan 14, 2014

@johnphan
Do you mean these?
version 1: non-versioned model + setupCoreDataStackWithStoreNamed
version 2: non-versioned model + setupCoreDataStackWithAutoMigratingSqliteStoreNamed
version 3: versioned + setupCoreDataStackWithAutoMigratingSqliteStoreNamed

Thanks!!

Are there any other ways for migration when the store is set up with setupCoreDataStackWithStoreNamed ?

@tonyarnold tonyarnold closed this Apr 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment