Debian – How to create backups when upgrading Debian

backupdebianupgrade

I want to upgrade my Debian lenny to squeeze but as I'm doing it for the first time I was thinking how to create the backup mentioned in the release notes:

The main things you'll want to back up are the contents of /etc,
/var/lib/dpkg, /var/lib/apt/extended_states and the output of dpkg
–get-selections "*" (the quotes are important). If you use aptitude
to manage packages on your system, you will also want to back up
/var/lib/aptitude/pkgstates.

Best Answer

rsync to copy the data to another machine, or tar up those directories and then just copy that file somewhere else.

The key thing is that once you've starting migrating to Squeeze, if it goes really badly, you're better off trashing your server and just installing Squeeze and putting your data back.

For that you need,

  1. a complete list of what's installed (dpkg --get-selections)
  2. how everything is configured (mostly /etc)
  3. a copy of all your user data (/home, /srv, /var in some cases)
  4. knowledge of how to put it back together

So it's not enough just to do what the Debian docs suggest, you need to secure all your data and now how to rebuild the server from scratch (IMO).