• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Cleaning up after manual Core Data migration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cleaning up after manual Core Data migration


  • Subject: Cleaning up after manual Core Data migration
  • From: Rick Mann <email@hidden>
  • Date: Thu, 11 Sep 2014 15:38:32 -0700

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
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Cleaning up after manual Core Data migration
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: NSUserDefaults not sticking
  • Next by Date: Re: Cleaning up after manual Core Data migration
  • Previous by thread: FYI, SQLite-based geo-queries are broken in Yosemite DP7
  • Next by thread: Re: Cleaning up after manual Core Data migration
  • Index(es):
    • Date
    • Thread