Problem when using Migration Managers and journal_mode WAL #490

pbendersky opened this Issue May 24, 2013 · 8 comments


None yet

5 participants


Hi guys,
I recently discovered a bug when using a Migration Manager to make advanced migrations in Core Data (I migrated a many-to-many to an entity, that's why I needed it) and journal_mode = WAL (the default for MR).

It seems as if Core Data keeps the old -wal file after performing the migration, ending up with an inconsistent database. You can see more details (and a workaround) here:

I also submitted a Radar to Apple over this issue:

Do you think MagicalRecord should implement a workaround like the one I described?


I think you're exactly right. I'm in the WWDC lab right now and I'm about to ask about it.

jogu commented Jul 5, 2013

@blackgold9 Did you find out anything further in the lab?


I did. He was pretty sure there's a bug in pre 7 that didn't clean out the
sidecar files on migrations. The trick another contributor added for auto
migrations was, when detecting a migration was necessary, opening it in the
normal journaling mode (DELETE i believe), which wipes out the sidecar
files, doing the migration, then re-opening the PSC with WAL again. I think
we can do something similar for manual migrations.

On Fri, Jul 5, 2013 at 4:01 AM, Joseph Heenan notifications@github.comwrote:

@blackgold9 Did you find out anything
further in the lab?

Reply to this email directly or view it on GitHub


Yes, that's the workaround I posted in Radar and what I'm using in my app. It works, although I wonder how safe it is for a larger DB.

ziel commented Aug 19, 2013

In case it's useful... I just ran into something similar. I'm using the concept from pbendersky's workaround which seems to make things ok. So err... +1 or something.


Can you duplicate the bug report in Radar? Maybe it will gather more attention for the next release.

ziel commented Aug 23, 2013

Submitted a report at I modified your description slightly to reflect what I saw -- which is an empty store... but referenced your report in Radar.


Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues.

If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks!

@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