How to backup before a release upgrade from Ubuntu 18.04.5 LTS server?
Colin Watson
cjwatson at ubuntu.com
Sun Sep 12 12:08:40 UTC 2021
On Sun, Sep 12, 2021 at 08:38:58AM +0200, Bo Berglund wrote:
> Step 1 (important) is to make a backup, but it says NOTHING about how to do
> that..
>
> I have tried to figure out how but failed, most search hits talk about setting
> up regular backup systems for the *data*, and they assume there is a desktop
> too. But this is a headless server accessed via SSH using PuTTY on Windows.
>
> What I need is something that can restore the ubuntu system itself rather than
> the data.
I use the "rsbackup" package for this, which is basically a smart
wrapper around rsync backups that deals with the various bits of
automation and management that you really should have for backups but
that would be tedious to write yourself. It's packaged in Debian (and
hence Ubuntu).
The procedure for a full restore is documented in rsbackup(1). Of
course you need some kind of running system at the remote end in order
to be able to do a restore; I've done this from a live USB stick on
laptops, and for a headless server it should be fine as long as the
upgrade hasn't killed SSH.
> I have a 500 GB disk drive with 199 GB free space.
> It stores a lot of video content (198 GB) as well as a subversion server
> repository (6 GB). And the Ubuntu system of course...
>
> I would like to get advice on how I can make a backup from which can restore the
> 18.04.5 system if the upgrade fails but will not include the videos.
With rsbackup you can use the "exclude" volume directive, documented in
rsbackup(5).
> Note that I need the LetsEncrypt certificates to not stop working and the
> certbot updates of certificates to still be in place!
In addition, I strongly recommend installing etckeeper - I have it
installed on all my systems. It automatically maintains the history of
your /etc directory in a local git repository, by default committing
around apt operations and in a daily cron job (you can also commit
things by hand if you want more informative commit messages, but you
don't have to).
This means that you have a local copy of previous states of /etc that
you can fish things out of if you need to, which would include things
like Let's Encrypt certificates. You wouldn't want to use this for a
full-system restore (/etc often has to be maintained in sync with the
rest of the system), but it's great for trying to figure out when and
roughly why something changed, or repairing minor configuration errors
after a mostly-successful upgrade.
Actually retrieving information from etckeeper requires a bit of
familiarity with git, but just having it installed doesn't.
--
Colin Watson (he/him) [cjwatson at ubuntu.com]
More information about the ubuntu-users
mailing list