How to restore from a backup¶
Put the database back from a backup on a machine where InteLIS already runs. Uploaded files and attachments can come back too.
Restoring replaces everything in the database. Records entered after the backup was made are lost.
How far back the backups go
The newest database backups, about the last 2 days, are on this machine and in the off-machine mirror. The off-machine backup also keeps one database backup per day for 7 days and one per week for 4 more weeks, about 5 weeks in all. To restore one of those, follow the Older date tab.
Choose the situation that fits, then follow its steps from top to bottom.
Use this when the database backup is still on this machine, for example to undo records deleted by mistake.
Restore the database¶
-
Open a terminal and go to the InteLIS folder:
cd /var/www/intelisOn older installs, type
cd /var/www/vlsminstead. -
Start the restore:
sudo -u www-data php vendor/bin/db-tools restore -
A list of the backups on this machine appears. Choose the newest file starting with
vlsm-that was made before the problem. Move to it with the arrow keys and press Enter. If the list is numbered, type its number and press Enter.The name gives the date and time of the backup. For example,
vlsm-20260903-100002-…was made on 3 September 2026 at 10:00.Do not choose a file starting with
interfacing-orpre-restore-.If it says
No backup files foundThere are no database backups on this machine. Follow the Only the database tab to fetch one from where the backups are sent.
-
Wait for
Restore completed to vlsm. The restore first saves a safety copy of the current database, in a file starting withpre-restore-vlsm-.If it ends with
Restore failedThe database may now be empty. Put the safety copy back. Run step 2 again and choose the newest file starting with
pre-restore-vlsm-. Then contact support with the message shown. -
Apply the database updates for this version of InteLIS:
intelis migrate
Check the lab¶
- Open InteLIS in the browser.
- Log in with an administrator account that existed when the backup was made.
- Check the lab settings under Admin → Settings → General Configuration.
- Open a request entered shortly before the backup, and check its results are there.
Use this when the backups are sent to another Linux machine, a Windows shared folder or a USB drive, and only the data needs to come back.
Fetch the backup¶
-
Open a terminal and go to the InteLIS folder:
cd /var/www/intelisOn older installs, type
cd /var/www/vlsminstead. -
Start the restore:
intelis restoreThe command checks for the current restore script before it runs. If the machine is offline, it uses the installed script.
-
At Fetch the backup from there?, choose Yes. The script uses the backup settings saved on this machine.
If it asks Where is the backup stored? instead
This machine has no saved backup settings. Choose where the backups are, then answer the questions for it:
Choice Questions On another Linux machine The username, the hostname or IP address, and the SSH port (press Enter for 22). Then type that user's password when asked.In a shared folder on a Windows machine The hostname or IP address, the name of the shared folder, the Windows username, and its password. On a USB or external drive plugged into this machine Choose the drive from the list. The script finds its backupsfolder, then asks which lab to restore. If the backup is elsewhere, choose Browse folders inside a drive. Open folders until you reach the backup, then choose Use this folder.If it says
Could not connectCheck the machine or drive is switched on and connected to the network, and that the details are right. Choose Yes at Try different details? (or Try again?) and type them again.
-
At Which lab should be restored?, choose this lab. Each row starts with the lab name given when the backups were set up, and shows the newest database backup.
If it says
There are no backups in …The script reached a place that holds no InteLIS backups. On the machine that sends the backups, run
intelis backup status. TheBacking up toline shows where they go. -
At What should be copied back?, choose Just the database backups.
-
At Where should the restore folder be created?, press Enter to use
/var/intelis-restore. Write down the new restore folder shown next. It looks like this:/var/intelis-restore/centrallab-12345678-20260928-120000.ABCDEFEach restore uses a new folder. Files fetched by an earlier restore cannot be selected by mistake.
-
Wait for the copy to finish. The script then checks each database backup. Files listed as encrypted are not checked. They open during the restore.
If a file is reported as damaged
Check that another backup is listed as readable. At the confirmation, type the backup name. The script skips damaged files and restores the newest readable backup.
Restore the database¶
- Check the displayed backup file and target installation. At Type … to confirm that this is the backup to restore, type the lab name exactly as shown.
-
Wait for
Database restored. The script first saves a safety copy of the current database, then restores the newest backup starting withvlsm-, then applies the database updates.If it says
The restore did not finishIf the next line says
No safety copy was taken, the database was not changed. Contact support with the message shown.Otherwise the database may now be empty. Put the safety copy back. The script prints the command to use. Replace
<pre-restore-file>with the name of the file starting withpre-restore-vlsm-in/var/www/intelis/backups/db(/var/www/vlsm/backups/dbon older installs), run it, then contact support with the message shown.If it says
The database is restored, but its migrations did not finishThe data is back. Apply the updates by hand:
intelis migrate
Check the lab¶
- Open InteLIS in the browser.
- Log in with an administrator account that existed when the backup was made.
- Check the lab settings under Admin → Settings → General Configuration.
- Open a request entered shortly before the backup, and check its results are there.
-
If the lab uses the interfacing tool, restore its database too. Type this, followed by a space. Do not press Enter yet:
sudo -u www-data php vendor/bin/db-tools restore --profile=interfacingOpen the Files app and press Ctrl+L. Type the restore folder from step 6, followed by
/db, and press Enter. Drag the newest file starting withinterfacing-onto the terminal window, and press Enter.Always keep
--profile=interfacingin this command. Without it, the file is restored over the main database. -
When the lab works, run the exact cleanup command printed by the script. It removes only this fetched copy, which holds the database password.
Use this to put the database back as it was on an earlier day, for example when a mistake is noticed after more than 2 days. The off-machine backup keeps one database backup per day for 7 days and one per week for 4 more weeks.
Fetch the backup¶
-
Open a terminal and go to the InteLIS folder:
cd /var/www/intelisOn older installs, type
cd /var/www/vlsminstead. -
Start the restore:
intelis restoreThe command checks for the current restore script before it runs. If the machine is offline, it uses the installed script.
-
At Fetch the backup from there?, choose Yes. The script uses the backup settings saved on this machine.
If it asks Where is the backup stored? instead
This machine has no saved backup settings. Choose where the backups are, then answer the questions for it:
Choice Questions On another Linux machine The username, the hostname or IP address, and the SSH port (press Enter for 22). Then type that user's password when asked.In a shared folder on a Windows machine The hostname or IP address, the name of the shared folder, the Windows username, and its password. On a USB or external drive plugged into this machine Choose the drive from the list. The script finds its backupsfolder, then asks which lab to restore. If the backup is elsewhere, choose Browse folders inside a drive. Open folders until you reach the backup, then choose Use this folder.If it says
Could not connectCheck the machine or drive is switched on and connected to the network, and that the details are right. Choose Yes at Try different details? (or Try again?) and type them again.
-
At Which lab should be restored?, choose this lab. Each row starts with the lab name given when the backups were set up, and shows the newest database backup.
If it says
There are no backups in …The script reached a place that holds no InteLIS backups. On the machine that sends the backups, run
intelis backup status. TheBacking up toline shows where they go. -
At What should be copied back?, choose An older database backup (choose a date).
-
At Which date should be restored?, choose the day. Each row shows the date and time the backup was made.
If it says
There is no dated history in this backup yetThe history starts with the first backup made after InteLIS was updated. Until then, only the newest backups exist. Follow the Only the database tab instead.
-
At Where should the restore folder be created?, press Enter to use
/var/intelis-restore. Write down the new restore folder shown next. It looks like this:/var/intelis-restore/centrallab-12345678-20260928-120000.ABCDEFEach restore uses a new folder. Files fetched by an earlier restore cannot be selected by mistake.
-
Wait for the copy to finish. The script then checks the backup. A file listed as encrypted is not checked. It opens during the restore.
If the file is reported as damaged
Do not type the backup name at the confirmation. Run
intelis restoreagain and choose another date.
Restore the database¶
- Check the displayed backup file and target installation. At Type … to confirm that this is the backup to restore, type the lab name exactly as shown.
-
Wait for
Database restored. The script first saves a safety copy of the current database, then restores the chosen backup, then applies the database updates.If it says
The restore did not finishIf the next line says
No safety copy was taken, the database was not changed. Contact support with the message shown.Otherwise the database may now be empty. Put the safety copy back. The script prints the command to use. Replace
<pre-restore-file>with the name of the file starting withpre-restore-vlsm-in/var/www/intelis/backups/db(/var/www/vlsm/backups/dbon older installs), run it, then contact support with the message shown.If it says
The database is restored, but its migrations did not finishThe data is back. Apply the updates by hand:
intelis migrate
Check the lab¶
- Open InteLIS in the browser.
- Log in with an administrator account that existed when the backup was made.
- Check the lab settings under Admin → Settings → General Configuration.
- Open a request entered shortly before the backup, and check its results are there.
-
If the lab uses the interfacing tool, its database stays as it is. To put it back to the same day too, contact support.
-
When the lab works, run the exact cleanup command printed by the script. It removes only this fetched copy, which holds the database password.
Use this when the backups are sent to another Linux machine, a Windows shared folder or a USB drive, and uploaded files and attachments are missing as well as data.
Fetch the backup¶
-
Open a terminal and go to the InteLIS folder:
cd /var/www/intelisOn older installs, type
cd /var/www/vlsminstead. -
Start the restore:
intelis restoreThe command checks for the current restore script before it runs. If the machine is offline, it uses the installed script.
-
At Fetch the backup from there?, choose Yes. The script uses the backup settings saved on this machine.
If it asks Where is the backup stored? instead
This machine has no saved backup settings. Choose where the backups are, then answer the questions for it:
Choice Questions On another Linux machine The username, the hostname or IP address, and the SSH port (press Enter for 22). Then type that user's password when asked.In a shared folder on a Windows machine The hostname or IP address, the name of the shared folder, the Windows username, and its password. On a USB or external drive plugged into this machine Choose the drive from the list. The script finds its backupsfolder, then asks which lab to restore. If the backup is elsewhere, choose Browse folders inside a drive. Open folders until you reach the backup, then choose Use this folder.If it says
Could not connectCheck the machine or drive is switched on and connected to the network, and that the details are right. Choose Yes at Try different details? (or Try again?) and type them again.
-
At Which lab should be restored?, choose this lab. Each row starts with the lab name given when the backups were set up, and shows the newest database backup.
If it says
There are no backups in …The script reached a place that holds no InteLIS backups. On the machine that sends the backups, run
intelis backup status. TheBacking up toline shows where they go. -
At What should be copied back?, choose Everything, including uploaded files and attachments.
-
At Where should the restore folder be created?, press Enter to use
/var/intelis-restore. Write down the new restore folder shown next. It looks like this:/var/intelis-restore/centrallab-12345678-20260928-120000.ABCDEFEach restore uses a new folder. Files fetched by an earlier restore cannot be selected by mistake.
-
Wait for the copy to finish. It copies the whole InteLIS folder and can take hours over a network. The script then checks each database backup. Files listed as encrypted are not checked. They open during the restore.
If a file is reported as damaged
Check that another backup is listed as readable. At the confirmation, type the backup name. The script skips damaged files and restores the newest readable backup.
Restore the database¶
- Check the displayed backup file and target installation. At Type … to confirm that this is the backup to restore, type the lab name exactly as shown.
-
Wait for
Database restored. The script first saves a safety copy of the current database, then restores the newest backup starting withvlsm-, then applies the database updates.If it says
The restore did not finishIf the next line says
No safety copy was taken, the database was not changed. Contact support with the message shown.Otherwise the database may now be empty. Put the safety copy back. The script prints the command to use. Replace
<pre-restore-file>with the name of the file starting withpre-restore-vlsm-in/var/www/intelis/backups/db(/var/www/vlsm/backups/dbon older installs), run it, then contact support with the message shown.If it says
The database is restored, but its migrations did not finishThe data is back. Apply the updates by hand:
intelis migrate
Put the uploaded files back¶
-
Save the restore folder from step 6 in the terminal. Replace the example with the path shown by the script:
restore_dir="/var/intelis-restore/centrallab-12345678-20260928-120000.ABCDEF" -
Check what the copy holds:
ls "$restore_dir/public/uploads" -
List what would be copied, without changing anything:
sudo rsync -a --dry-run --itemize-changes "$restore_dir/public/uploads/" /var/www/intelis/public/uploads/Each line is a file that is missing or different on this machine.
-
Copy the files across:
sudo rsync -a "$restore_dir/public/uploads/" /var/www/intelis/public/uploads/On older installs, type
/var/www/vlsm/public/uploads/as the last path. Do not add--delete. Files added since the backup would be removed.Then copy back the audit trail, which holds the change history of older samples:
sudo rsync -a "$restore_dir/var/audit-trail/" /var/www/intelis/var/audit-trail/On older installs, type
/var/www/vlsm/var/audit-trail/as the last path. -
Repair the file ownership, so the web server can read the restored files:
sudo intelis provision
Check the lab¶
- Open InteLIS in the browser.
- Log in with an administrator account that existed when the backup was made.
- Check the lab settings under Admin → Settings → General Configuration.
- Open a request entered shortly before the backup, and check its results are there.
- Open a result PDF or an attachment, and check it displays.
-
If the lab uses the interfacing tool, restore its database too. Type this, followed by a space. Do not press Enter yet:
sudo -u www-data php vendor/bin/db-tools restore --profile=interfacingOpen the Files app and press Ctrl+L. Type the restore folder from step 6, followed by
/backups/db, and press Enter. Drag the newest file starting withinterfacing-onto the terminal window, and press Enter.Always keep
--profile=interfacingin this command. Without it, the file is restored over the main database. -
When the lab works, run the exact cleanup command printed by the script. It removes only this fetched copy, which holds the database password.