Pin It

How To Backup and Restore Cydia Application Before iPhone Upgrade

iPhone Cydia BackupEvery time you upgrade a jailbroken iPhone to a new version of firmware (or iPhone OS), as you know, it is required to go through the whole jailbreak process again. That means, all your iPhone applications and Cydia applications are completely removed. For iPhone applications, you can back them up by syncing via iTunes. But how about those cydia applications? iTunes will not take care this kind of applications. So, how can you backup these apps and restore them after iPhone upgrade?

One way is to use AptBackup, which is available on cydia. The way how AptBackup works is that it saves a list of Cydia-installed applications, backup the list via iTunes and restore the list back to your iPhone. Later, cydia can refer to that list and install all the applications again. I have covered this app very long time ago and you can check out the review here.

As reported by some users, however, they just can’t get AptBackup work. Today, I am going to show you a manual way to backup and restore cydia applications. If AptBackup doesn’t work for you, you can use this manual approach to backup and restore the applications.

The manual approach requires you know about SSH or DiskAid. At least, you need to know how you can transfer file between iPhone and computer. To learn more about it, you can refer to this post of How to Use SSH to Transfer File on iPhone.

Okay, here we go.

Backup Cydia Application

1. First, make sure you have installed OpenSSH, MobileTerminal and Gawk on your jailbroken iPhone. All these packages can be found on cydia if you miss any of them.

2. Launch Terminal app.

3. In terminal, type “su” and followed by the root password. Please note your password will not be echoed. If you haven’t changed the root password, just key in “alpine” and tap return.

4. Then type dpkg -l | grep ^ii | awk '{print $2}' > /var/root/cydiabkup.txt and then tap return key.

5. After you execute the command, it automatically retrieves the list of cydia applications installed on your iPhone and saves it into the cydiabkup.txt.

6. Next, transfer /var/root/cydiabkup.txt from iPhone to your computer using SSH or Diskaid. To let you have an idea of the backup file, here is how the file looks like:

The file just contains a list of cydia of applications you have installed. Later, you will need to use the file again after iPhone upgrade.

Once the cydiabkup.txt is copied to your computer, it is safe to upgrade your iPhone and jailbreak it again.

Restore Cydia Applications after iPhone Upgrade

Okay, now you have completed the iPhone upgrade and I assume you have already jailbroken the iPhone again with cydia installed.

1. Before you can restore the cydia applications, make sure you install OpenSSH, MobileTerminal, Gawk and APT 0.7 Strict packages from cydia. These packages are used during restoration process.

Note: Before you move on, make sure you disable Auto-Lock. You can go to Settings -> General -> Auto-Lock and tap “Never”.

2. Download install-cydia-app.zip and unzip it

3. By using SSH or Diskaid, transfer both “cydiabkup.txt” (the file that you have generated in the backup process) and “install-cydia-app.sh” (the file you just unzip in step 2) to your iPhone under /var/root folder.

4. Launch Terminal app and type “su” to logon as root. Same as before, use “alpine” as password.

5. Next, type sh /var/root/install-cydia-app.sh and tap return key.

6. After running the command, it will automatically download the cydia applications and install them accordingly. When prompt “After this operation, xxMB of additional disk space will be used. Do you want to continue [Y/n]?“, simply key in “Y” and tap return. Depending on the number of cydia apps to install, the process may take five to ten minutes.



7. Once the installation completes, restart your iPhone and all cydia apps should be restored.

Troubleshooting…

Thing normally goes straightforward. But it’s not uncommon you may encounter some hiccups. If you experience errors like Couldn't find package xxxx, that means the cydia application is no longer available for download. What you have to do is to edit the “cydiabkup.txt” on your computer and delete those obsolete packages. Afterwards, transfer the updated “cydiabkup.txt” back to your iPhone and continue with step 4 again.

As always, should you have any questions, please feel free to leave me comment below. If you find other ways to backup and restore cydia apps, feel free to share it with us.

About Simon Ng

Founder, developer and chief blogger of simonblog.com

, , , ,

40 Responses to How To Backup and Restore Cydia Application Before iPhone Upgrade

  1. Spamdumpster February 11, 2010 at 5:49 am #

    Here’s an easier way. Prior to updating, run this command: dpkg –get-selections > myapps.txt. Then backup the myapps.txt file to your mac or pc and restore your firmware.

    Once restored, install the cydia packages you indicated, then SSH and run the following commands in order

    dpkg –set-selections < myapps.txt
    apt-get -u dselect-upgrade
    rm /private/var/mobile/Library/Caches/com.apple.mobile.installation.plist
    killall SpringBoard

    • Simon Ng February 11, 2010 at 11:36 pm #

      @spamdumpster,

      Great Tip! Thanks a lot.

    • FuRrY321 February 22, 2011 at 8:17 am #

      Well… crap. Spamdumpster, I realize that your post was over a year ago, but this method didn’t work, and now I’ve lost all my Cydia apps.

      What this did was backup all the default stuff that came with Cydia (read: the core files, sources, packages, etc.) but it didn’t list any of the things I had personally installed. My own fault really, for not checking the .txt more thoroughly, but I saw text, figured since something actually APPEARED then by golly it must work! Then I proceeded with the restore, just to learn that – well s***.

    • Dave June 25, 2012 at 4:39 am #

      So I backed up my iphone in itunes.Is there a way to reinstall the apps from there?How do I identify the app in the backup location?

  2. RJ February 12, 2010 at 12:59 am #

    Here is an even easier way: install Rock on your iPhone and create a Rock account with only your email and a password. Rock gonna save the 5 latest stage of your JB apps and you can restore any time. Saved me hours and hours of search and install last time when I upgraded to 3.1.2.
    Just my 2 cents.

  3. Samson February 26, 2010 at 12:22 am #

    Beside the applications, isn’t it possible to create a FULL backup of the complete iPhone3GS/iPod Touch3 root partition to the user data partition? I am just thinking since Apple is no longer allow recover to OS 3.1.2 if we can at least create a tarball of the whole existing OS then we can just simply restore the full system just in case things being messed up..

  4. EMale1965 May 2, 2010 at 12:31 am #

    I have tried this procedure and when I open the cydiabkup.txt file it is empty. I have done this several times. What am I doing wrong? I should also say that before the Terminal goes back to the var/mobile root# command it shows a list of other commands and options and then produces the var/mobile root# command. It also says: “Options marked [*] produce a lot of output – pipe it through ‘less’ or ‘more’ !” What does this mean and how do I get this to work? I am using a jailbroken 32GB iPhone 3GS with firmware 3.1.2. Any help would be appreciated. It is a real pain to re-install all the Cydia apps after a restore.

  5. dzoi July 22, 2010 at 5:33 pm #

    how about apps installed via installous? is there a way to create a backup for that?

    • Sal October 11, 2011 at 3:06 am #

      You don’t need to backup apps from Installous. They should stay on your idevice even after updating your iPod. However, you won’t be able to open them until you rejailbreak and install Installous.

    • dinesh May 13, 2012 at 3:08 pm #

      you can visit http://www.devicera.com and there its shown how to backup your installous downloaded .isp files

  6. SErgio October 14, 2010 at 5:55 am #

    I getting the followin error:
    Oprtions marked [*] produce a lot of output – pipe it through ‘less’ or ‘more’ !

    Can you please advise?

  7. Salud November 3, 2010 at 7:01 am #

    Its not working for me, every time i write the code i get “dpgk: unknown option -1″

    • Eric January 28, 2011 at 2:21 am #

      You are type dash one, the command is dash “ell” as in L instead of 1 but the L is lower-case.

  8. Ed November 5, 2010 at 12:58 am #

    The most common mistake is to use a single leading hyphen (-) for options to the dpkg command. Be sure to use two leading hyphens (–) and things should work for you.

  9. Matine December 30, 2010 at 6:29 pm #

    Hi all

    1- How to get Gawk ?
    2- I can intall MobileTerminal but can’t open, How ?

    my iphone :
    Firmware : 05.13.04
    Version : 4.1 (8B117)

    • ash January 6, 2011 at 3:08 pm #

      Some of this is out of date. I dint think Mobile Terminal works on iOS 4.0+ at all.

  10. Fabio Gangarossa January 9, 2011 at 4:23 am #

    Excellent article, the procedure works perfectly, however I believe you should mention that you must re-insert the Cydia repositories manually for things to work smoothly.

    Thanks again!

  11. Moe February 8, 2011 at 8:55 pm #

    Yes exactly Fabio – very important step that you have to take note of the repos where you installed your apps from and write them down and then before you can run the restore commands you first have to MANUALLY ADD those REPOS back to Cydia else the commands will run and not find the repo, and hence not find the app you had.

  12. chikanoz February 14, 2011 at 4:49 pm #

    hi simon. i cant seem to install “gawk” from cydia. app not found. is it on a different repo?
    also my mobile terminal crash each time i launch. hmm.. can u help?

    • Simon Ng February 15, 2011 at 12:55 am #

      What version of iOS are you using? Mobile terminal does not work for the latest version of iOS.

  13. Nickm2 April 5, 2011 at 9:52 am #

    This would work GREAT if only the restore process, well, actually worked. I’m getting an error with the .sh file on line 4. no clue wtf to do now. -Had over 100 packages from cydia-
    iPod Touch 4G
    Firmware 4.3.1
    Redsn0w 0.9.6rc9 untether

    • Fabio Gangarossa April 5, 2011 at 4:02 pm #

      This method DOES work! Perhaps you could tell us what error you are getting? Did you remember to enter your Cydia repos manually BEFORE you run the script?

  14. Naitch April 8, 2011 at 12:37 am #

    Hi I keep getting the error that it couldn’t find the package. But if I got into cydia and search for the item I can find it and install manually. I’v added all the sources I had before so that shouldnt’ be the problem. Thanks in advance!

  15. ColdGlueGun April 25, 2011 at 3:06 am #

    Yea…I made sure I has all the dependencies to run this. I entered allof my cydia repos. The mobile terminal process went perfectly but then when i turned off my ipod then back on, the only thing that was installed was installous. NONE of my other cydia apps were there! NONE were installed. Any Ideas? Please.

    thanks.
    -ColdGlueGun

  16. schirin May 2, 2011 at 6:01 am #

    Hi guys, i’m getting error “awk: command not found”.

    I can’t find Gawk in cydia. is there another source i need to add to find Gawk?

    Simon, can you update your instructions for 4.3.2?

    • Simon Ng May 2, 2011 at 6:50 pm #

      @schirin,

      Thanks. The guide has been written base on earlier version of iOS. I’ll test it with the latest version of iOS soon.

  17. mago May 2, 2011 at 9:35 pm #

    he is here http://www.cydia-iphone.fr/ work fine for me

  18. Tom October 31, 2011 at 11:21 pm #

    What if the user has not done a backup?
    recover photos from iphone

  19. NEO December 4, 2011 at 7:40 pm #

    Mistake delete file var lib apt list on iphone 4 how to recovery back i dont have any backup

  20. You are great February 1, 2012 at 2:24 pm #

    Thank you so much because of this I was able to update my ipod to 5.01 and still get my cydia apps back. THANK YOU \(^-^)/

  21. hamzah June 9, 2012 at 8:26 pm #

    i have tried this and the backup process worked perfectly. i restored to the same firmware as it was before (5.0.1) and typed in the command
    sh /var/root/install-cydia-app.sh
    it said install:target “winterboard” is not a directory

  22. st christopher pendant necklace August 28, 2014 at 12:01 pm #

    Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my
    blog that automatically tweet my newest twitter
    updates. I’ve been looking for a plug-in like this for quite some time and was hoping
    maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

Trackbacks/Pingbacks

  1. How to Backup and Restore Your Jailbreak Apps | How to Unlock - February 16, 2010

    […] wrote an interesting tutorial on his blog on how to manually backup your jailbreak apps. Read it if you’re […]

  2. How Backups and Restore your Jailbreak Apps | Tutorials, Tips and How to's - October 25, 2010

    […] It appears that Aptbackup’s interface is simple and straight forward, but there have been reports that the app doesn’t work the way it should while most users, recommend the $5 Pkgbackup. I guess you get what you paid. Just make sure to backup your iPhone in iTunes before doing any of the method above. Now for the more savvy jailbreakers, you can manually back up and restore cydia apps by following the instructions clearly explained on this page. […]

  3. iPhone Hack: How to Backup & Restore Your Jailbreak Apps | iPhone Hacks - Guide for Jailbreaking your iPhone 4, iPhone 3gs and iPhone 3g - January 18, 2011

    […] wrote an interesting tutorial on his blog on how to manually backup your jailbreak apps. Read it if you’re […]

  4. Backing Up Your Cydia Packages | How's My App - February 12, 2011

    […] [via SimonBlog] […]

  5. manually backup cydia apps and ssettings - April 20, 2011

    […] pkgbackup does. If you want to know how to do it manually you can do it by following this tutorial here or you can follow one this one that uses a mix between pkgbackup manual ssh […]

Leave a Reply