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 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 thoughts on “Restoring iPhone Camera Roll via USB or SSH file copy

  • February 17, 2013 at 1:20 pm

    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

  • March 26, 2013 at 8:49 am

    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.

  • June 27, 2013 at 2:39 pm

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


Leave a Reply

Your email address will not be published. Required fields are marked *