1

Let me describe my problem first:

At work, we have an Ubuntu 14.04.1 LTS server which is obviously kinda outdated. I need to make a release upgrade and before that, there needs to be a backup. We have a Windows 2012 Server which would have enough space to store the backup. I googled and found a solution to keep the permissions, which would be lost if I just cp -a everything:

dd if=/path/to/dir bs=1G | gzip > /path/to/backup/backup.tar.gz

So in that .tar.gz file, the permissions should be kept.

My idea was it to run the dd for every dir which I needed to backup:

/etc, /home, /var

Next step would be to create a package list to reinstall all the packages. Found a solution here: (it's german but I guess you understand what they do)

apt-get create package list

After that, I should have a directory /backup/ where all the .tar.gz files and the package lists are. This dir I would copy to our Windows server and do the release-upgrade on the Ubuntu server. If the upgrade messes with the system I can easily restore everything if I run the dd with reversed if and of.

Now my question(s):

Did I miss anything (in general/directories I need to restore the System/etc)?

Is there a better way to do it?

I hope my English isn't too bad and thank you for your help.

NIMISHAN
  • 1,575
  • 4
  • 19
  • 28
  • 1
    Welcome to [ubuntu.se]! Can you reboot the server and boot a live medium? If yes, there is a ready-to-use solution for backups called Clonezilla. IMHO you should either upgrade (using do_release_upgrade) or replace your OS, don’t mix them (using a package list for a different OS version, particular directory from the old version, etc.) unless the more straightforward methods fail. – Melebius Sep 24 '19 at 09:23
  • dd can be used to copy a file or a partition or a whole drive (cloning), but here I think you should use tar (to get a 'tar.gzfile:sudo tar -cvzf /path/to/backup/backup-of-dirx.tar.gz /path/to/dirx` – sudodus Sep 24 '19 at 09:28
  • Sadly no live boot possible. The package list was more of an idea to remember to packages which were installed. Like in a django project you normally have a requirements.txt where all the python libs are wrote in.

    So the sudo tar is the better option? and run that for all my dirs to backup?

    – Holger P. Sep 24 '19 at 09:33
  • 1
    Yes, you can read man tar and you can find good tutorials about tar via the internet. – sudodus Sep 24 '19 at 10:14
  • Thank you very much. – Holger P. Sep 24 '19 at 10:15
  • Several answers at this link may be useful for you to identify which program packages you may want in the next version of Ubuntu Server. – sudodus Sep 24 '19 at 10:22
  • Tanks again for your help. – Holger P. Sep 24 '19 at 11:02
  • You are welcome and good luck :-) – sudodus Sep 24 '19 at 11:13
  • 1
    If you cannot reboot your machine, then my answer on cloning a running server might come in handy. – Melebius Sep 24 '19 at 13:00

0 Answers0