Restoring iPhone Camera Roll via USB or SSH file copy


For those who hate that blasted peesashit iTunes and who wish to restore your photos and movies back into your jailbroken iPhone using straight file transfer, here is the trick to getting it done quickly and with a minimum of fuss.

1a) You can use SSH via Wifi if you don’t have that many photos to transfer

1b) If you have a LOT of movies and photos, use a USB file transfer utility like iFunBox to transfer the Photos back into /User/Media/DCIM/100APPLE

2) Now for the critical part, merely transferring the photos back into the directory above will not cause them to show up in the Camera Roll.  What you need to do as well is to delete some of the stuff inside /User/Media/PhotoData (or to play it safe, copy them into a directory called, say, Original/).

According to this page, you only need to delete two .plist and two .sqlite files.  (Under iOS 5.0.1 on my 3GS, only one .plist file under /User/Media/PhotoData/MISC seems to exist and it was named DCIM_APPLE.plist.)  In my case, I moved over all the files under /User/Media/PhotoData to a backup directory and then recreated just the directory structure, remembering to chown mobile.mobile all these newly created directories.

3) Now, reboot your iPhone and call up the Photos app.  At this point, nothing will still show up because iOS is busy recreating the files you deleted. You should wait for a few minutes (the more stuff you have, the longer you should wait), then the next time you go into the Photos/Camera Roll app, you should now see your old photos and movies!

3 Responses to Restoring iPhone Camera Roll via USB or SSH file copy

  1. Mario says:

    Thanks for sharing!

    Here is a simple script to does all the mentioned stuff (used on 3GS with iOS 6.0.1):
    su mobile
    cd /var/mobile/Media
    mv PhotoData PhotoData.bak
    mkdir PhotoData
    chmod 750 PhotoData
    cd PhotoData
    mkdir AlbumsMetadata
    chmod 700 AlbumsMetadata
    mkdir MISC
    chmod 700 MISC
    mkdir PhotoCloudSharingData
    chmod 755 PhotoCloudSharingData
    mkdir Thumbnails
    chmod 755 Thumbnails
    mkdir Videos
    chmod 755 Videos

  2. oomkoos says:

    YAY! Thanks guys, this also sorts out the whole non-custom-sortable album issue, at least i dont have to scroll my ass off to show someone my latest pics.

  3. kiruban says:

    thank you aloot bro ! because of u i finally can do it !! tq aloot !!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>