1

I recently submitted an upgrade of my app which included a lightweight coredata migration (including new fields in existing tables and a couple of new tables). I followed every tip regarding this migration, including some I found on this site.

I thoroughly tested the update on three different devices and it all went ok!!!

However, this update is crashing an all my devices and probably on all my customers. I can't explain why this is happening.

Could you please help me understand this debacle?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Mariano
  • 11
  • 2
  • 1
    Do you have crash logs? We can't really provide an answer without some sort of starting point and "everything is crashing" isn't really a point but more of a broad area. – TechZen Mar 22 '11 at 17:50

2 Answers2

1

To truly test your app and migration, you need to run your original app to create data store according to the original data model. Then you need to run your new app, opening data store that was generated with original app. This can be a real pain and is easier (at least initially) to do in Simulator because you have more control over the file system and can swap in a saved original data store. On iDevice you need to regenerate original data store for each test.

If you are testing on your own development devices then you have already migrated your data store. Is it possible that your test devices created their data stores with new data model - and never actually performed a migration?

westsider
  • 4,967
  • 5
  • 36
  • 51
  • I tried both ways. 1) Installing the previous version from Xcode and then installing the new version from Xcode, and 2) Installing the previous version directly from the App Store, and then installing the new version from Xcode. Both tests yielded good results, the data model was automatically migrated with no errors. The problem arises from the new version distributed in the App Store. – Mariano Mar 23 '11 at 02:09
  • And the App Store version works fine when there's no existing data to migrated? – westsider Mar 23 '11 at 02:47
0

I only generally use automatic migration during beta testing, for quick revisions, other than that I always use a mapping model, so that you have control.

the other issue is that if your model shifts far enough between releases, auto migration from v1-v2 could be fine, and v2-v3 could be ok, but v1-v3 could be too drastic to be inferred. by making maps for them, you retain control of the migration.

MCannon
  • 4,011
  • 2
  • 16
  • 12