How to backup and restore Ubuntu Touch for official and unofficial devices
Today I will show you how to make a manual backup of your Ubuntu Touch system and then to restore it. Begin with connecting to adb by plugging your device into a PC and open command line/terminal and run this command:
sudo adb root
sudo adb shell
- Are you a blogger? Now you can make money from Muktware....check it out: Muktware's Bloggers Network
Find your filesystem size
sudo du -hs /
Create your backup folder and cd into it:
mkdir -p /home/phablet/backup && cd /home/phablet/backup
Create your backup excluding some pointless files and folders
tar cvpjf backup.tar.bz2 –exclude=/proc4 –exclude=/mnt –exclude=/sys / –exclude=/lost+found –exclude=/tmp –exclude=/backup.tar.bz2 -exclude=/SWAP.swap -exclude=/data/media/*
This process can take upwards of 10-60 minutes, it really depends on what device and how many files you have.
After your backup is complete we need to pull it from the device.
If you’re still in adb shell, Type:
And then to pull it
sudo adb pull /home/phablet/backup.tar.bz2 /home/USERNAME/FOLDER/LOCATION/
Recovering your backup while Ubuntu Touch is on (same if the display manager only shows a black screen).
Open your terminal and type:
sudo adb push /home/USERNAME/FOLDER/LOCATION/backup.tar.bz2 /home/phablet/backup/
Then access the shell
sudo adb shell
and then restore your device
sudo tar xvpfj /home/phablet/backup/backup.tar.bz2 -C /
Could take awhile just like backing up.
Then reboot and you should be restored.
sudo reboot -p