Server upgrade of the newe server

Ah, I see. Lets try to get some structure:

  • old server = A
    • A got a backupA of 271 GB on 20220116
    • A has user adminA that has ssh-access
    • A will be shut down on March 31
    • A is: at home and will be sold / at a VPS / at another place that will close at the end of the month?
  • new server = B
    • B got a new, empty Yunohost installation
    • B got user adminB that has ssh-access
    • B is: at home / at a VPS / somewhere else
  • Internet connection between the two is via mobile internet / 4G connection? Does the backup have to be downloaded that way, or only SSH commands via 4G ?

You want to move backupA from A to B, and then restore it there, so that you don’t lose your two years of work on the server.

The easiest way is to do the restore of backupA on B instead of yunohost postinstall. If you already did the postinstall, you can still restore the backup. Warning: it only works if you did not create users and/or installed software etc on B.

The backups are in /home/yunohost.backup/archives, and exist of duo’s of the backup.tar itself and backup.info.json metadata. You need to copy both!

So, onto the work itself. I imagine you start working on your desktop, and then jump from system to system this way:

$ carrabelloy@desktop:~$ ssh admin@serverA
password etc
$ admin@serverA:~$ # check that the backup is there
$ admin@serverA:~$ ls /home/yunohost.backup/archives/
...
..20220116.tar
..20220116.info.json
... 
$ admin@serverA:~$ # ok, it is there
$ admin@serverA:~$ # now go to B
$ admin@serverA:~$  ssh admin@serverB
password etc 
$ admin@serverB:~$ # lets check that the backup location is available
$ admin@serverB:~$ ls /home/yunohost.backup/
archives 
$ admin@serverB:~$ # OK, it is there. 
$ admin@serverB:~$ # Check that we are allowed to write here
$ admin@serverB:~$ cd /home/yunohost.backup/archives
$ admin@serverB:/home/yunohost.backup/archives $ getfacl .
# file: .
# owner: admin
# group: root
user::rwx
group::r-x
other::---

$ admin@serverB:/home/yunohost.backup/archives $ # yes, admin is owner, and is allowed to write. Lets get the archive
$ admin@serverB:/home/yunohost.backup/archives $ scp admin@serverA:/home/yunohost.backup/archives/20220116.* . 
... wait a while ...
$ admin@serverB:/home/yunohost.backup/archives $ ls -ahls 
 20k 20220116....info.json
271G 20220116....info.json
$ admin@serverB:/home/yunohost.backup/archives $ sudo yunohost backup list 
  - ... 
  - ... 
  - 20220116-....
  - ... 

$ admin@serverB:/home/yunohost.backup/archives $ # looks good, you could restore now
$ admin@serverB:/home/yunohost.backup/archives $ sudo yunohost backup restore 20220116-.... 

That is how I speculate things would go. There are a few if’s and but’s:

  • It is easier if you got backupA-system and backupA-apps split, so that you can first restore domains and users, and then restore the apps.
  • The list above is how I imagine it would work, but if you get stuck, please copy the whole list of commands as text, not only a screenshot of a small part of your terminal client
  • If your internet connection is stable enough, you could mount the archives-directory via SSHFS, and not copy the backup before restoring
  • If your internet connection is not stable enough: are you familiar with screen or tmux command line apps? They are very helpful to continue after a dropped connection
  • Please give some insight in the situation, where the servers are (at home, VPS, etc) and whether you got enough free space or that it maybe is running out.
  • I think you can just copy/paste the commands above, and replace serverA and serverB with your domains/IP’s; just be sure to read what it is doing in case I made a mistake.

Good luck!

1 Like