Restore with back in time after fresh install of ubuntu

7,110

EDIT: There are two more detailed articles on BackInTime FAQ on how to backup and restore package selections.

Yes. This will work. Make sure you have included everything that is important to you in your last snapshot. Run this commands to backup your PPA's and package selection:

mkdir ~/.apt-backup
sudo dpkg --get-selections > /home/<USER>/.apt-backup/package.list
sudo cp -aR /etc/apt/sources.list* /home/<USER>/.apt-backup/
sudo apt-key exportall > /home/<USER>/.apt-backup/Repo.keys

Just to make sure there are no corrupt files in snapshot you should run one last snapshot with Use checksum to detect changes enabled in Options on your old machine. (starting from 1.0.28 there is a command-line option --checksum for this, too. So you don't need to enable and than disable it again anymore).

Setup your new machine, install backintime again and copy config from your last snapshot folder /path/to/backintime/HOST/USER/1/SNAPSHOT_ID to ~/.config/backintime/.

If Backintime doesn't find your old snapshots directly, go to Settings disable Auto Host - User - Profile and change Host and User entry so they match your old machine. Now restore your home directory (and all other folders which are important to you).

Recreate your /etc/apt/sources.list if you had set something special in there. If your Ubuntu version changed don't just copy them from ~/.apt-backup/sources.list

Restore apt-keys for your PPA's with sudo apt-key add ~/.apt-backup/Repo.keys

Make some "housecleaning" in ~/.apt-backup/package.list. For example you don't want to install the old kernel again. So run sed -e '/^linux-\(image\|headers\)/d' -i ~/.apt-backup/package.list

Finally install all your old packages again with:

sudo apt-get update
cat ~/.apt-backup/package.list | sudo dpkg --set-selections
sudo apt-get dselect-upgrade
Share:
7,110

Related videos on Youtube

Heisenberg
Author by

Heisenberg

PhD student in social science

Updated on September 18, 2022

Comments

  • Heisenberg
    Heisenberg over 1 year

    I back up my home, which includes a list of installed softwares and PPA, on an external hard drive using back in time. I plan to do a fresh install of ubuntu. Will I then be able to install back in time on the fresh machine, then restore everything from there?

    From what I have read on the internet, there are certain pitfalls, e.g. the two Ubuntu installs must be configured exactly the same, back in time settings must be the same, and I can only restore one folder at a time (!)

  • Heisenberg
    Heisenberg over 10 years
    Great answer! You should put this on Back-in-time FAQs somewhere since I think that most people need Back-in-time for disaster relief / fresh install case like this instead of the "Time machine"-like functionality.
  • Oleksandr Shmyrko
    Oleksandr Shmyrko over 10 years
    That was my plan :) BTW I'm part of BIT dev team
  • Heisenberg
    Heisenberg over 10 years
    I recognized your name :D Ubuntu has been failing me so I've been frequenting BIT launchpad a lot lately :(