Migrating From One Ubuntu Machine to Another¶
Move a lab to a new Ubuntu machine, or rebuild a machine that has died, from the old machine's backups.
The new machine must run Ubuntu 24.04 LTS or later and be connected to the internet.
Choose the situation that fits, then follow its steps from top to bottom.
On the old machine¶
-
Open a terminal and take a fresh backup, so nothing entered since the last automatic backup is lost:
intelis backupIf it asks
Set up off-machine backups now?, press Enter (No).If
intelisis not recognisedThe install is older. Export the database with this instead:
cd ~ && wget -O db-backup.sh https://raw.githubusercontent.com/deforay/intelis/master/scripts/db-backup.sh sudo bash db-backup.sh- Enter the MySQL username and password.
- Choose the
vlsmdatabase, andinterfacingif the lab uses the interfacing tool. - When asked for the location, enter
/var/www/intelis/backups/db. On older installs, enter/var/www/vlsm/backups/db. - Wait for
Script completed.If it printsThese databases were NOT backed up, stop.
If MySQL will not start
Nothing can be backed up until MySQL runs. Follow MySQL will not start, then come back to step 1.
-
Plug a USB drive into the old machine.
-
In the terminal, type this, followed by a space. Do not press Enter yet:
sudo cp -r /var/www/intelis/backupsOn older installs, type
/var/www/vlsm/backupsin place of/var/www/intelis/backups. -
Open the Files app. Drag the USB drive from the left sidebar onto the terminal window. Its path appears after the command.
- Press Enter. The
backupsfolder is copied onto the USB drive. - Unplug the USB drive.
On the new machine¶
- Plug in the USB drive.
-
Open a terminal and download the installer:
cd ~ && wget -O setup.sh "https://raw.githubusercontent.com/deforay/intelis/master/scripts/setup.sh?v=$(date +%s)" -
Type this, followed by a space. Do not press Enter yet:
sudo bash setup.sh --restore-from-backup-folder -
Open the USB drive in the Files app. Drag the
backupsfolder onto the terminal window. Its path appears after the command.Instead of dragging, click the folder once and press Ctrl+C. Then click in the terminal and press Ctrl+Shift+V. If the path has spaces and no quotes around it, add
'at both ends. -
Press Enter, then answer the installer's questions:
Question Answer Installation directory Press Enter. Which backup should be restored? Press Enter. The newest backup is on top and already selected. What is this machine? Lab machine (LIS). Remote STS URL The STS address the old machine used. Leave it empty if the lab has no STS. New MySQL root password A new password for this machine, typed twice. Write it down. Is this correct? Check the summary, then press Enter (Yes). -
Wait 10 to 20 minutes. The installer ends with
Setup complete.If it stops with
Failed to decryptSetup could not open the backup with the old machine's settings in
backups/config. Ask the STS administrator for a one-time recovery token. They run this on the STS:cd /var/www/intelis && sudo -u www-data php bin/backup-key-admin.php approve --lab <lab-id>Then repeat steps 9 to 11, adding the STS address and the token after the folder path:
sudo bash setup.sh --restore-from-backup-folder '<folder>' --sts-url https://sts.example.org --recovery-token ABCD-EFGH-JKMN-PQRSThe second run asks
Reuse your previous setup answers and skip the prompts?. Press Enter (Yes) to reuse the answers. If it saysAn existing database was found, choose Keep a copy, then start fresh.
Check the lab¶
- Open InteLIS in the browser.
- Log in with an administrator account from the old machine. Do not create a new one. The restored database already holds the users, the lab settings and all the data.
- Check the lab settings under Admin → Settings → General Configuration.
-
If the lab uses the interfacing tool, restore its database too.
- In a terminal, type
sudo cpfollowed by a space. Do not press Enter yet. - Drag the newest file starting with
interfacing-from thedbfolder onto the terminal. Then type/tmp/and press Enter. -
Restore it into the interfacing database:
cd /var/www/intelis && sudo -u www-data php vendor/bin/db-tools restore --profile=interfacing /tmp/interfacing-* -
Delete the copy:
sudo rm /tmp/interfacing-*
If step 3 reports that the profile
interfacingdoes not exist, set up the interfacing tool first with Setting up the interfacing tool, then repeat step 3. If it reports that it cannot open an encrypted file, contact support with the file name. - In a terminal, type
Use the backups folder that was copied off the old machine.
Check the copied folder¶
- Plug the USB drive with the copied folder into the new machine.
-
Open the
backupsfolder in the Files app. Check it holds both of these folders:Folder What it holds dbThe database backups. configThe old machine's settings. The key to the database backups is read from here. If
configis missing, carry on. Step 8 shows what to do if the backup does not open. -
Open
dband find the newest file starting withvlsm-. Its name gives the date and time of the backup. For example,vlsm-20260903-100002-…was made on 3 September 2026 at 10:00. The lab returns to that point.
Do not rename any file. Each file's name is part of its key.
Install and restore¶
-
Open a terminal and download the installer:
cd ~ && wget -O setup.sh "https://raw.githubusercontent.com/deforay/intelis/master/scripts/setup.sh?v=$(date +%s)" -
Type this, followed by a space. Do not press Enter yet:
sudo bash setup.sh --restore-from-backup-folder -
Drag the
backupsfolder from the Files app onto the terminal window. Its path appears after the command.Instead of dragging, click the folder once and press Ctrl+C. Then click in the terminal and press Ctrl+Shift+V. If the path has spaces and no quotes around it, add
'at both ends. -
Press Enter, then answer the installer's questions:
Question Answer Installation directory Press Enter. Which backup should be restored? Press Enter. The newest backup is on top and already selected. What is this machine? Lab machine (LIS). Remote STS URL The STS address the old machine used. Leave it empty if the lab has no STS. New MySQL root password A new password for this machine, typed twice. Write it down. Is this correct? Check the summary, then press Enter (Yes). -
Wait 10 to 20 minutes. The installer ends with
Setup complete.If it stops with
Failed to decryptThe installer could not find the key. Either the
configfolder was not copied, or the backup uses a key held by the STS. Ask the STS administrator for a one-time recovery token. They run this on the STS:cd /var/www/intelis && sudo -u www-data php bin/backup-key-admin.php approve --lab <lab-id>Then repeat steps 5 to 7, adding the STS address and the token after the folder path:
sudo bash setup.sh --restore-from-backup-folder '<folder>' --sts-url https://sts.example.org --recovery-token ABCD-EFGH-JKMN-PQRSThe second run asks
Reuse your previous setup answers and skip the prompts?. Press Enter (Yes) to reuse the answers. If it saysAn existing database was found, choose Keep a copy, then start fresh.If this machine cannot reach the STS, ask the STS administrator for the recovery code instead. They get it by running this on the STS:
cd /var/www/intelis && sudo -u www-data php bin/backup-key-admin.php show-code --lab <lab-id>Then run:
sudo bash setup.sh --restore-from-backup-folder '<folder>' --encryption-password '<recovery-code>'
Check the lab¶
- Open InteLIS in the browser.
- Log in with an administrator account from the old machine. Do not create a new one. The restored database already holds the users, the lab settings and all the data.
- Check the lab settings under Admin → Settings → General Configuration.
-
If the lab uses the interfacing tool, restore its database too.
- In a terminal, type
sudo cpfollowed by a space. Do not press Enter yet. - Drag the newest file starting with
interfacing-from thedbfolder onto the terminal. Then type/tmp/and press Enter. -
Restore it into the interfacing database:
cd /var/www/intelis && sudo -u www-data php vendor/bin/db-tools restore --profile=interfacing /tmp/interfacing-* -
Delete the copy:
sudo rm /tmp/interfacing-*
If step 3 reports that the profile
interfacingdoes not exist, set up the interfacing tool first with Setting up the interfacing tool, then repeat step 3. If it reports that it cannot open an encrypted file, contact support with the file name. - In a terminal, type
Use this when the old machine sent its backups to another Linux machine or a Windows shared folder.
Fetch the backups¶
-
On the new machine, open a terminal and run:
cd ~ && wget -O restore-backup.sh https://raw.githubusercontent.com/deforay/intelis/master/scripts/restore-backup.sh sudo bash restore-backup.sh -
Answer where the backups are stored, and sign in when asked.
- Choose the lab from the list.
- Choose Just the database backups.
- Press Enter to accept the folder it offers.
- Wait for the copy to finish. Near the end it prints a two-line command
starting with
cd ~ && wget -O setup.sh. Select both lines and press Ctrl+Shift+C to copy them.
Install and restore¶
- Press Ctrl+Shift+V to paste the command, then press Enter.
-
Answer the installer's questions:
Question Answer Installation directory Press Enter. Which backup should be restored? Press Enter. The newest backup is on top and already selected. What is this machine? Lab machine (LIS). Remote STS URL The STS address the old machine used. Leave it empty if the lab has no STS. New MySQL root password A new password for this machine, typed twice. Write it down. Is this correct? Check the summary, then press Enter (Yes). -
Wait 10 to 20 minutes. The installer ends with
Setup complete.If it stops with
Failed to decryptThe backup uses a key held by the STS. Ask the STS administrator for a one-time recovery token. They run this on the STS:
cd /var/www/intelis && sudo -u www-data php bin/backup-key-admin.php approve --lab <lab-id>Then paste the command from step 6 again. Before pressing Enter, add the STS address and the token at the end:
--sts-url https://sts.example.org --recovery-token ABCD-EFGH-JKMN-PQRSThe second run asks
Reuse your previous setup answers and skip the prompts?. Press Enter (Yes) to reuse the answers. If it saysAn existing database was found, choose Keep a copy, then start fresh.
Check the lab¶
- Open InteLIS in the browser.
- Log in with an administrator account from the old machine. Do not create a new one. The restored database already holds the users, the lab settings and all the data.
- Check the lab settings under Admin → Settings → General Configuration.
-
If the lab uses the interfacing tool, restore its database too.
-
Copy the newest interfacing backup out of the fetched folder:
sudo bash -c 'cp "$(ls -t /var/intelis-restore/*/db/interfacing-* | head -1)" /tmp/' -
Restore it into the interfacing database:
cd /var/www/intelis && sudo -u www-data php vendor/bin/db-tools restore --profile=interfacing /tmp/interfacing-* -
Delete the copy:
sudo rm /tmp/interfacing-*
If step 2 reports that the profile
interfacingdoes not exist, set up the interfacing tool first with Setting up the interfacing tool, then repeat step 2. If it reports that it cannot open an encrypted file, contact support with the file name. -