Re: converting coredata files
Re: converting coredata files
- Subject: Re: converting coredata files
- From: Charles Srstka <email@hidden>
- Date: Thu, 07 Feb 2013 13:38:51 -0600
On Feb 2, 2013, at 1:09 PM, Amy Heavey <email@hidden> wrote:
> I've got an app that I write for myself (I am the only user). I made a mistake when creating the datamodel in xcode 3 (targeting 10.5), I used "description" as an attribute name. I have now upgraded and the current xcodes do not like the project file at all.
>
> I've got quite a lot of data in this app that I really don't want to loose. It uses an sql store.
>
> Somehow I need to create a new app for 10.8 that will use the old file, or find a way to convert the old file to work with a new app. The new app will be almost the same but only have the current datamodel.
>
> Can I create an intermediate datamodel in xcode 3 that removes the error from the file, and create an app. Open the file with this version to upgrade it to the current datamodel. Then create an xcode project without the old datamodels and use that?
Things like this are part of why the concept of CoreData makes me a bit uncomfortable — you don't have control of your own file format. If the format for this were open, building a converter to fix your problem would be a snap.
Since your problem is relatively simple, though, it might not be too hard to reverse-engineer. You could just go through one of your files with the /usr/bin/sqlite3 tool, figure out where it's storing the "description" attribute name, and then make a program using libsqlite3 to make a new sqlite database and copy everything exactly from the old one to the new one, with the exception that it changes the "description" attribute name to something else when it comes across it.
Charles
_______________________________________________
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