title: iCloud data backup and restore strategy
body: <p>Don't know if this type of question is ok here but I'll ask anyway.</p>
  
  <p>I have an iOS iCloud Core Data application that works decently well (though I think it does need some synchronization tweaking) and am considering allowing the user so save a copy of the database to iCloud drive in a UIDocument.  This would allow the user to possibly segment the database manually and load only the portions they want to use at the moment as well as provide peace of mind considering that the data may include some insurance claims data.</p>
  
  <p>I'm weighting several alternatives to allow this to happen.</p>
  
  <p>Option 1 is to just create an iOS based save and restore process which, when triggered, would dump the database (maybe at max 1000 objects) into an NSArray of NSDictionary objects (one dictionary per row) and then JSONize the NSArray into NSData and save it in a new UIDocument on iCloud drive.  A restore process would list possible archives to restore and then allow the user to pick one.  The restore process would do the reverse of the save process.</p>
  
  <p>Option 2 would be to create Mac App to handle the save/restore process which would allow the user to save the archives on the user's Mac.  This seems a lot less difficult though it would require a set of apps working together.  The mechanism would be similar as option 1 but the data would go to a file specified in a standard Mac file system pick screen.</p>
  
  <p>Personally, I'd like to do both of them but before I start I want to make sure that there's not an easier way than dumping the entire SQL database into an NSArray of NSDictionaries.  </p>
  
  <p>A complicating factor is that the database contains images which are in the database as NSData.  I could string-ize the NSData, add it into the NSDictionary build, then let the JSON process do it's thing.  </p>
  
  <p>I'm just fine with proceeding this way but I wanted to make sure I wasn't overlooking some type of Apple method of doing this in an easier way.</p>
  
  <p>Another thought that came to me was maybe using some sort of SQLite utility to do save and restore locally in one session which would then replicate the results across all of the devices via iCloud. Again, sounds like more of a Mac answer to me but I don't really know.</p>
  
  <p>Again, any suggestions would be great.</p>