Replacing a failed appliance with a full restore

On Monday morning the atlas server of John Smith Ltd no longer starts: the system disk is gone. Nobody can reach mail, the \\atlas\... folders, the domain, the phones. The appliance was however…

Situation

On Monday morning the atlas server of John Smith Ltd no longer starts: the system disk is gone. Nobody can reach mail, the \\atlas\... folders, the domain, the phones. The appliance was however backed up every night on two USB disks and on the NAS nas.johnsmith.test (Backing up servers and PCs).

The partner prepares a new machine. With the full restore the new appliance is put back on its feet as it was at the last backup: configuration, domain, mail, databases, services, certificates and shared files. It is not the same as the console’s Backup → Restore (which brings back chosen files, folders or dumps on a running appliance, see Restoring): here a whole machine is rebuilt.

For the technician The design is in info/done/DR.md (edon-backup 1.3.3). Every scheduled backup, even «Configuration only», writes to /var/lib/edon-backup/dr the database roles, the schemas, the containers’ secrets and a manifest.json (packages, interfaces, units, services), and saves the service images with podman save in snapshots of their own. PostgreSQL’s data directory is not in the backup: the dumps are enough. The restore loads the images instead of rebuilding them, because the builders would rewrite the configuration that has just been restored and change the database passwords. Behind the page there is edon-backup-dr (list, start, run, status).

What you need

  • A new machine with at least the specification of the old one and the same disk layout (/srv/data/mail, /srv/data/share, /srv/data/pods with suitable space). Installed from the Atlas ISO, not with a hand-prepared Debian.
  • A recent Atlas ISO. The restore installs the package versions saved in the backup (if they are missing, the latest ones; those already newer are kept), so the ISO’s version does not have to match.
  • The archive password of the original appliance (the only key to the backups). Without it there is no restore. It should be in the office password manager: if it is not, no other steps are needed, the restore is not possible.
  • The storage with the backups and its credentials: the USB disks Disk A or Disk B (connected to the new machine), or the NAS nas.johnsmith.test with share backup-atlas, user backup-atlas and its password.
  • The new machine connected to the same network, with the same fixed address as the old one (10.20.0.2) and the old appliance switched off.
  • A PC on the same local network: the wizard answers only to the local network (the /24 of the main address) or through an SSH tunnel.
  • Time: from a few minutes to a few hours, depending on the amount of data.

Warning The old appliance and the new one must never be on the network at the same time: after the restore the new one becomes the same machine (same name, same domain, same secrets). If the old one is repaired, reinstall it from scratch before reconnecting it.

Warning The restore replaces all the configuration and data of the machine on which you launch it. Do it on the new machine, just installed, not on one already in use.

Steps

Prepare the machine and reach the wizard

  1. Install the machine from the ISO. During installation give it the same fixed address as the old one (10.20.0.2) and, as far as you can, the same name (atlas). The network is restored from the backup only if the interfaces have the same names as before; otherwise the one just installed stays and the restore reports it.
  2. From a PC on the LAN open http://10.20.0.2/. A freshly installed appliance has no users: every address leads to the wizard, which asks for no login. From the home network or from the internet nothing answers: use an SSH tunnel with ssh -L 8080:127.0.0.1:80 root@10.20.0.2 and open http://localhost:8080/.
  3. On the «Welcome» page do not press «Continue»: press «Restore from a backup». It skips all the other pages (Licence, Owner, Registration, Installation).
The Welcome page with «Restore from a backup»The Welcome page with «Restore from a backup»
The Welcome page with «Restore from a backup»

Say where the backups are

  1. On the «Restore from a backup» page choose one of the three ways in «Where the backup is»:
    • «Network folder (SMB)»: fill in «Server» nas.johnsmith.test (or the full path \\nas.johnsmith.test\backup-atlas), «Share», «User» backup-atlas, «Password» <password>, «SMB version» SMB 3 and, if needed, «Mount options»;
    • «Disk attached to the appliance»: give «Folder» (for example /media/backup-a, the point where the USB disk is mounted);
    • «S3 storage»: «Endpoint» https://s3.example.test, «Bucket» johnsmith-backup, «Prefix», «Region», «Access key» and «Secret key».
  2. Type the «Archive password». It is the one set in Settings › Backup on the original appliance, not a new one.
  3. Press «Look for backups». The wizard opens the storage and shows the list «Backups available» (date, daily/weekly/monthly type, id).

Warning If the NAS used the failed appliance as its DNS server, the mount fails after about 20 seconds («The storage cannot be reached…»): Samba looks up the name of each client before answering, and that lookup waits for a server that no longer exists. Before restoring, assign another DNS on the NAS (for example the router’s).

Choose the backup

  1. In the list, backups made in «Configuration only» mode are marked («configuration only: no shared files or mail»): they have neither shared files nor mail. Others may be marked «no shared files» or «no mail». The most recent one that contains everything is preselected.
  2. Choose the backup to use. Usually it is the most recent; if a failure or a virus has spoiled the data, choose an earlier one. Remember that whatever changed after that backup is lost (with the default schedule, up to 24 hours on working days and up to 72 at the weekend).
  3. If «No complete backup of the appliance on this storage» or «No backup on this storage is enough for a complete restore» appears, the backups were made before a version that saved the rebuild data. It is not your fault and it cannot be remedied: see the section «If something goes wrong».

Launch and follow the restore

  1. Press «Restore». The console asks: «The restore replaces all the configuration and data of this appliance with those of the chosen backup, then reboots it. Continue?». Confirm.
  2. The page becomes «Restoring» and shows the phases with their times: «Opening the backup», «Checking its content», «Software versions», «Stopping the services», «Configuration and data», «Service credentials», «Service images», «Databases», «Starting the services», «Final check». It refreshes by itself: you can leave it open and go for a coffee. It may take from a few minutes to a few hours.
  3. Do not switch the machine off and do not close the SSH tunnel if you use one. If the PC goes to sleep, reopen the page: the state of the restore is on the machine, not in the browser.
  4. At the end the page says «Restore complete.» and shows «The appliance reboots in N seconds: the network, the name and the proxy take effect, then the login page appears.». Read before the reboot, if you can, the «To check» panel and the «Restore log»: for each database it says whether it was restored, skipped or failed.

If the restore stops

  1. The restore stops at the first blocking error: the page says the phase and the reason («The restore stopped…»). The phases already completed must not be repeated: read the reason, remove the cause (storage, space, network) and press «Retry».

After the reboot

  1. When the login page appears, sign in as root or with a domain administrator (lwhite). The users are the same as before.
  2. In System → Status check that the services are active and that the «Warning» strip is empty. Every service without its image in the backup does not restart and is flagged in «To check».
  3. In System → Modules check that all the modules from before are there.
  4. Check the HTTPS certificate (System → Settings → TLS certificates): if you used Let’s Encrypt, check that the certificate is present and valid for the public name. The manual could not verify in the lab that the Let’s Encrypt certificate comes back intact: if it is missing, renew it from that block.
  5. In Backup → Storage press «Test» for each storage. The identity marker on the disk or the NAS is the same as before: you must read «Storage valid». If a disk is not connected, the label is «Disk not connected».
  6. The next day check Backup → Logs: the backups resume as before, including the clients’. The clients reconnect by themselves because the authority of their certificates is in /etc/edon, which has been restored; if one shows «Not authorized» or refused, check «Associated IP» in Backup → Clients and register again from the agent.

Check

A thorough test that the new machine really is the old one, to be done the same day:

  1. Domain and folders. From pc-admin-01 sign in as jgreen and open \\atlas\administration: the files are there, the permissions are those of before.
  2. Mail. With a mail program (IMAP) or with Tools → Mail read the mailbox of jsmith, send a test email to jgreen@johnsmith.test and check that it arrives. Also check Mail → Logs.
  3. Telephony. In Telephony → Extensions extensions 201–210 return to «Registered» after a few minutes (desk phones reconfigure themselves at reboot; if they do not, «Reconfigure now» in Telephony → Desk phones). Try a call between two extensions; in Telephony → Lines the provider’s line (198.51.100.50) returns to «Registered».
  4. Network and office. If the Argos office is connected to Atlas (see the scenario «Connecting the office to Argos»), check that the tunnel shows as active and that the 192.168.10.0/24 network is reachable.
  5. Backup. Press «Run now» in the «Backup» block of System → Settings, wait for «Backup finished» in Backup → Logs and do a test restore of a single file (Restoring).

If something goes wrong

  • «The storage cannot be reached…». Check address, share and credentials. If the NAS used the lost appliance as DNS, assign it another DNS. For a disk: «Folder» must be the point where it is mounted.
  • «This storage holds no appliance archive.». You chose the wrong storage (another folder, a different S3 prefix).
  • «The archive password opens no archive on this storage.». Wrong password. Try the one you have kept; it cannot be recovered or changed.
  • «No complete backup of the appliance on this storage» / «No backup on this storage is enough for a complete restore». The backups are too old (made before the version that saves the rebuild data) or partial. Try the other USB disk or another storage; if these are not enough either, the full restore is not possible: contact the technician, who can recover the loose data from the archives (shared files and mail) onto a new installation.
  • The network stayed the one from the installation. The new machine’s interfaces have names different from the old one’s: the saved network is not brought back. Check the addresses and rules in Network → Interfaces and Network → IPAM.
  • A service does not restart. Its podman save was not in the backup (missing image) or the service was not in use. It is listed in «To check»: restart it from System → Status (the only action is restarting a service) or ask the technician.
  • An application’s database has an owner without a password. A missing owner role is created without a password: the application must be provisioned again (it is written in the log).
  • The restore cannot be done on an appliance that is already configured. The «Restore from a backup» page appears only on a new installation. On one already configured you need the command-line override (force): it is a technician’s decision, because it erases what is there.
  • The domain controller coexists with a Windows one. The domain is not restored from a backup (risk of rolling back the update sequence number): you leave the domain and join it again. Ask the technician.
  • A message or an hour of work is missing. The restore brings each part back to its moment, but the data have different ages (domain, databases, mail are saved in the same cycle, minutes apart): the risk of losing data is that of the backup frequency. A daily cycle on Saturday and Sunday too would bring the maximum to 24 hours; with the default schedule (Mon–Fri) at the weekend it is up to 72.

For the technician The state is in /run/edon-backup/dr-restore.json and the final report in /var/lib/edon-backup/dr-restore-report.json; the restore runs in the transient unit atlas-dr-restore. The design says «tested on s01» (lab, new VM installed from the ISO); the manual could not repeat it on real hardware.

LET’S TALK INFRASTRUCTURE

Control starts with a conversation.

Tell us about your infrastructure. Let’s start with what you actually need.

Talk to an engineer