Database Reference
In-Depth Information
Where to go from here?
That was a whole lot of data migration! Migrations can be extremely tricky, as
you've no doubt observed in the more complicated forms in this chapter. Before
you move on to the next chapter, I want to share a few words of advice from my
experience using Core Data migrations.
First, when you decide a data migration is in order, make a reasonable effort to use
the simplest migration possible. Migrations can be tricky to test, so you want them
to be as simple as possible. And, as you've seen in this chapter, you can go a long
way without the need for the most custom of migrations involving code.
Second, make sure to save some data store versions for testing future migrations.
You'll thank yourself later. In some cases, real live data will be the only way to
break a migration. Sometimes, it may be useful to ask a customer's permission to
use their data store for testing a particular problem. Remember to use extreme
care with customer data and properly secure, anonymize or encrypt the files when
they aren't being used during a test.
Core Data migrations are one of the more powerful, and in many cases, useful,
aspects of the Core Data framework. Now that you've seen the spectrum of Core
Data migrations from lightweight all the way to fully custom manual migrations,
you'll be able to tackle data even the most difficult model changes in your own
apps.
 
Search WWH ::




Custom Search