How To Backup and Restore Cydia Application Before iPhone Upgrade

by Simon Ng on February 11, 2010



Every 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.

 Share with Your Friends

What's Next?

If you find the post is useful, subscribe to Simon Blog using RSS or Email to get free iPhone updates. Alternatively, you can follow me on Twitter or join us on Facebook.

Related Post you'll like:

Sign up and Download Free iPhone Guide

{ 6 comments… read them below or add one }

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

Reply

2 Simon Ng February 11, 2010 at 11:36 pm

@spamdumpster,

Great Tip! Thanks a lot.

Reply

3 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.

Reply

4 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..

Reply

5 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.

Reply

6 dzoi July 22, 2010 at 5:33 pm

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

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post:

Get smart with the Thesis WordPress Theme from DIYthemes.