Tutorial: Restore Personal Data from iDevice without using Backup after a Restore

We’re always told after each new jailbreak to not restore from a backup. It can eliminate those annoying errors and bugs, but it does take time. This, of course, clears out all personal information, which is often something that you want to keep. It’s one of the major tribulations about jailbreaking whenever you update. Guess what: there’s a way to keep this information without restoring from a backup. Guess what else: there’s a great guide that’s been written by forum member SomeWelshGuy.

You have to start the process before you actually jailbreak the phone, so that the information is still there. The process does take some knowledge, though it should be knowledge that you already have if you are jailbreaking. Read on for the full guide!

Extracting the data from the iPhone

Okay, so we’re going to get all of the data we need off the phone.

  1. SSH into your phone and navigate to /private/var/mobile/Library/
  2. Go into the “SMS” folder and copy sms.db to your computer.
  3. Go into the “AddressBook” folder and copy AddressBook.sqlitedb and AddressBookImages.sqlitedb to your computer.
  4. Go into the “Notes” folder and copy notes.db and notes.idx to your computer.
  5. Go into the “Calendar” folder and copy Calendar.sqlitedb to your computer.
  6. Now navigate to /private/var/wireless/Library/CallHistory and copy call_history.db to yout computer.
  7. Also copy all of your photos and videos from the Camera Roll to your computer. You don’t even need to SSH this, just access them from within windows explorer.

However App Store apps are a little different. To do this we’ll need to download iPhone Explorer.

  1. Plug your phone in via USB and launch iPhone Explorer
  2. Look on the left hand pane, and click “Apps”
  3. You should now see all your app data on the right. They’re usually named along the lines of com.developer.appname. So if I wanted to copy “Angry Birds” data, I should drag “com.clickgamer.AngryBirds” to my desktop to save it.

So now we’ve extracted the data from our iPhone. We can now restore and jailbreak.

When that’s done, you’ll need to install OpenSSH like before, in order to give us SSH access. Now we can move onto the next step.

Copying the data back to the iPhone

It’s pretty easy to copy the data back to the new jailbroken iPhone. Just get your backups you made earlier, and copy them into the locations you originally got them from. Overwrite the stock/empty files on the phone if asked.

However this causes some access problems for the phone, which can cause some stock apps to crash or loose data. We can now go and fix this.

Fixing your SMS

You may notice now that you try to send an SMS, the app crashes. This is due to an access problem. We can fix this by using a command line tool (such as puTTY), to SSH into our phone and fix this.
You can also achieve this through mobile terminal if you wish, however as these commands can get pretty lengthy it may be easier to just copy and paste them on the computer through SSH.

  1. SSH into your phone.
  2. Type chown mobile -R /var/mobile/ into the console and press return.
  3. Then either respring your device or type killall SpringBoard into the console to respring.

You can now send, receive and view SMS messages without any issues.

Copying your pictures and videos into the Camera Roll

By default, the Camera Roll is read only. It can only be modified under special conditions (taking a photo, saving an image). However we can use SSH to add our photos back into the camera roll.

The issue is that SSH is wireless, and so rather slow. Photos and videos are large, so could take quite a few hours to copy. I’ve found it easier, just for this step, to use a USB type explorer. It’s much, much faster.

Anything like DiskAid or iPhoneExplorer should be okay.

  1. Navigate to /private/var/mobile/Media/DCIM/
  2. If there’s a folder there, use that. If there’s no folder, create one called “100APPLE”.
  3. Copy your photos and videos into this folder. If you copied them from your iPhone before then they should all be named IMG_xxxx.JPG, .PNG or .MOV.
  4. Look at the last numbered photo in this folder. It could be IMG_0345.JPG for example. Take a note of this number.

Fixing photo library issues

Unfortunately, this confused the photo library and the images don’t show up. In order to fix this, we can do the following through SSH:

  1. Navigate to /private/var/mobile/Media/PhotoData
  2. Delete the following files: com.apple.photos.caches_metadata.plist, Photos.sqlite, Photos.sqlite.aside, PhotosAux.sqlite, PhotosAux.sqlite.aside.
  3. If any exist, delete all files from /private/var/mobile/Media/PhotoData/100APPLE
  4. Again, if any exist, delete all files from /private/var/mobile/Media/PhotoData/Thumbnails
  5. And once more, if any exist, delete all files from /private/var/mobile/Media/PhotoData/Videos

Now go to your iPhone, open the multitasking bar and close “Photos”. Then open the Photos app. Wait for the library to rebuild and you should see your photos and videos.

Fixing camera issues

However by doing this, the camera stops saving new photos. They appear to be saved, but once you close the Photos app all the photos you just took no longer show up. However we can fix this.

  1. SSH into your phone
  2. Navigate to /private/var/mobile/Media/DCIM/.MISC
  3. Open Info.plist in a text or .plist editor
  4. Replace the contents of the file with this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  1. Remember that number I told you to take note of earlier? Add one to that number. Then replace the xxxx in the contents you just pasted with this number. My number was 0345 in this case. So I’d replace xxxx with 346.

Now once again open command line SSH or mobile terminal.

  1. SSH into your phone
  2. Type the following command: cd /var/mobile/Media/ and hit return
  3. Then type chown -R mobile DCIM and hit return.

You should now find you can take photos fine, and they save properly.

Copying your selected App Data back onto your phone

This is fairly easly. Go into iTunes, and sync the apps you want to copy the data back to onto your phone. Then you need to simply launch iPhoneExplorer back up, go to Apps, and drag the app folder(s) you copied back onto your phone.

So phew! After all that hard work you should find that your SMS, Address Book, Notes, Calendar, Call Logs, Photos and Videos and selected App Data should now be exactly as they were before. And all on a fresh, clean jailbreak. Comment if you have any questions or concerns, and check out the forum guide for more information which is being updated all fairly often as more techniques and feedback comes in!

Post a response / What do you think?
This entry was posted in News. Originally submitted by SomeWelshGuy. 59 comments