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.

1 Answer 1


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

  • The Debian docs already seem scary and now this.. Just makes we want to stay in Lenny. :D
    – Rihards
    Sep 5, 2011 at 13:45
  • I moved to squeeze without any issues, just saying that if you get into a mess with dependencies, it can be easier to start again - if you have the data ready. Sep 5, 2011 at 16:03
  • By the way, one more thing which worries me. I'm using WinSCP and Putty to connect to the server and do everything in the command line. Will the command line window and connection to WinSCP be active while I upgrade so I can fix the issues?
    – Rihards
    Sep 5, 2011 at 16:16
  • You should make sure you run everything inside screen or tmux so that a dropped connection doesn't immediately cause issues, but if the upgrade stuffs openssh/network, then you'll need a remote console session to fix it. Sep 5, 2011 at 18:44
  • Sorry, but what's inside screen? It's like I run the linux server in virtual machine program on my windows?
    – Rihards
    Sep 5, 2011 at 20:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .