Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1081821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:13:03+00:00 2026-05-16T22:13:03+00:00

This is the best tutorial I found so far on migrating data across apps:

  • 0

This is the best tutorial I found so far on migrating data across apps:

http://www.mobileorchard.com/lite-to-paid-iphone-application-data-migrations-with-custom-url-handlers/

But it only discusses the case where you have total control over how the data is represented, such as would be the case if you were constructing your own archivable plist objects and moving them in and out of your documents directory. What if your app uses Core Data and you want to migrate a store across apps?

In my case I want to have a free app’s Core Data store get picked up by a paid app at launch. Let’s assume that I am going to use the pasteboard process as described above, such that iOS provides a great mechanism for saving NSData, launching an app, and claiming the NSData. So, how do you wrap a Core Data package in NSData?

To make this even feasible, let’s assume that the free version uses the same model or a subset model of the full version such that lightweight migration is confirmed functional. Is it possible to get the contents of a persistent store, feed them into an NSData object, and then unpack the NSData object to a new store? I’m just guessing that this would be a persistent store… the real question is, what would such an object be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:13:04+00:00Added an answer on May 16, 2026 at 10:13 pm
    NSPersistentStore *store = ...;    
    NSData *data = [NSData dataWithContentsOfURL:[store URL]];
    
    < pass it through the pasteboard >
    
    [data writeContentsToURL:newURL atomically:NO];
    

    The file at newURL is now a persistent store. You can add it to a persistent store coordinator in the usual way.

    This has several drawbacks compared to the recommended way of migrating stores to a different location in the file-system.

    1. You need to pull the entire store into memory.
    2. There are no safe-guards as to whether any contexts hooked up to the store are saved or not.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to follow this tutorial on how to connect to a database
I'm really disappointed with just about everything I find online that tries to teach
We just got our first major Perl CGI assignment in my CS class. Our
I'm starting to code my first game and I want to make simple 2D
I've been trying to build my first rails app and have gotten stuck on
I have an C# dll project for which I have to store the runtime
There are quite a number of modules on CPAN relating to the creation and
I've been a Java programmer almost exclusively for the past 8 years or so,
The Story After cleaning up my Dreamhost shared server's home folder from all the
My memory usage increases over time and restarting Django is not kind to users.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.