13
votes

I'm trying to migrate an iPhone/iPad sqlite store of about 11Mb. It has around thirty different entities, all quite heavily interrelated.

On a 3GS, it takes quite some time. Even a lightweight migration takes around four minutes.

I guess this is because all the relationships are held in memory.

Reading the Apple migration guide, it says that for large datasets, one approach is to do multiple passes using different mapping models.

All well and good. However, it seems that you can't do this if the entities in one mapping model are related to those in another. In fact, a compilation error is generated along the lines of "can't auto generate value expression with nil mapping name" in the Mapping Model xcmappingmodel file.

Any tips much appreciated.

Many thanks,

Max

1
Hi Max - did you ever find an answer to this? I've just realised I'm in the same boat as you (large dataset with highly-related entities) and some devices are not going to be able to perform a migration. I'm starting to think that the only way to actually manage this would be to do it completely custom (i.e. not using NSMigrationManager at all ... completely recreate the datastore yourself ... bleargh).glenc
Not yet I'm afraid as I've moved onto another project. My technique was to do a completely custom migration. Next time I see my colleague I'll ask if he managed to resolve it.Max MacLeod

1 Answers

1
votes

Cant you just create a new database with the new scheema and then start the migration process by reading from the old one and inserting to the new one ?