Up until now I've performed a complex Core Data migration using Mapping Models 
and custom migration policy subclasses, but initiated automatically upon 
creating the persistent store coordinator, and it works fine. But 
unfortunately, it's taking too long, so I have to initiate it manually on a 
background thread, with an instance of a migration manager I create, and then 
display some progress.

The problem is, I now have to specify the destination URL explicitly, and I'm 
not able to give it the source URL. So, I create a new sqlite data file, and 
that's fine. But the old sqlite DB actually has three files (DB.sqlite, 
DB.sqlite-shm, DB.sqlite-wal), so when I swap the new and old files after the 
migration completes, there's still leftover sqlite metadata in the form of 
these additional files, and SQLite thinks the newly migrated DB is corrupt.

I can, of course, just delete these additional files, but it's an 
implementation detail I'd rather not put in my code. Am I overlooking some more 
elegant way to update the on-disk files?

TIA,

-- 
Rick Mann
rm...@latencyzero.com



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to