How to backup before a release upgrade from Ubuntu 18.04.5 LTS server?

Ralf Mardorf kde.lists at yahoo.com
Sun Sep 12 07:27:29 UTC 2021


On Sun, 12 Sep 2021 08:38:58 +0200, Bo Berglund wrote:
>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.

Hi,

actually it's you who missed to do the home work in the first place
;). Do you have physical access to the server? If you are _not_ using a
file system that allows to take snapshots from a running system, such
as ext4 (it doesn't provide this feature), the best approach is to shut
down the server first. From another install or a live media (DVD, USB
stick) you can backup the complete install. I'm doing this for my
desktop machine all the time. For a headless server on the other side
of the flat earth, I would use a file system that allows to take
snapshots, so I probably would be in favour of FreeBSD over Linux.

However, assuming you can shut down the machine and e.g. insert an USB
stick, then copy by running

sudo cp -ai /mount_point_install/* /mount_point_backup_media/

The "a" option is mandatory, the "i" option isn't.

Alternatively just one tar example

sudo tar --xattrs -czf /m_point_install/* /m_point_backup_med/bak.tar.gz

The advantage of tar is, that you even can backup to a non-unixoid
file system, but still preserve permissions and attributes, you can
compress the backup, e.g. using gunzip and you can encrypt the archive
afterwards. The disadvantage is, that it takes way more time, than a
copy.

Linux provides sync software, but you don't need the advantages of a
sync, so don't risk to suffer from doing mistakes when using sync
software. Don't mess around with dd or similar commands.

If you don't have got physical access, then you aren't necessarily
lost, but you probably need to learn how to do really good Google
research. It might be possible to take snapshots from a file system
that doesn't support the snapshot feature.

Regards,
Ralf




More information about the ubuntu-users mailing list