Skip to content

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

  1. Open a terminal and go to the InteLIS folder:

    cd /var/www/intelis
    

    On older installs, type cd /var/www/vlsm instead.

  2. Start the restore:

    sudo -u www-data php vendor/bin/db-tools restore
    
  3. 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- or pre-restore-.

    If it says No backup files found

    There are no database backups on this machine. Follow the Only the database tab to fetch one from where the backups are sent.

  4. Wait for Restore completed to vlsm. The restore first saves a safety copy of the current database, in a file starting with pre-restore-vlsm-.

    If it ends with Restore failed

    The 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.

  5. Apply the database updates for this version of InteLIS:

    intelis migrate
    

Check the lab

  1. Open InteLIS in the browser.
  2. Log in with an administrator account that existed when the backup was made.
  3. Check the lab settings under Admin → Settings → General Configuration.
  4. 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

  1. Open a terminal and go to the InteLIS folder:

    cd /var/www/intelis
    

    On older installs, type cd /var/www/vlsm instead.

  2. Start the restore:

    intelis restore
    

    The command checks for the current restore script before it runs. If the machine is offline, it uses the installed script.

  3. 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 backups folder, 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 connect

    Check 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.

  4. 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. The Backing up to line shows where they go.

  5. At What should be copied back?, choose Just the database backups.

  6. 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.ABCDEF
    

    Each restore uses a new folder. Files fetched by an earlier restore cannot be selected by mistake.

  7. 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

  1. 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.
  2. Wait for Database restored. The script first saves a safety copy of the current database, then restores the newest backup starting with vlsm-, then applies the database updates.

    If it says The restore did not finish

    If 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 with pre-restore-vlsm- in /var/www/intelis/backups/db (/var/www/vlsm/backups/db on older installs), run it, then contact support with the message shown.

    If it says The database is restored, but its migrations did not finish

    The data is back. Apply the updates by hand:

    intelis migrate
    

Check the lab

  1. Open InteLIS in the browser.
  2. Log in with an administrator account that existed when the backup was made.
  3. Check the lab settings under Admin → Settings → General Configuration.
  4. Open a request entered shortly before the backup, and check its results are there.
  5. 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=interfacing
    

    Open 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 with interfacing- onto the terminal window, and press Enter.

    Always keep --profile=interfacing in this command. Without it, the file is restored over the main database.

  6. 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

  1. Open a terminal and go to the InteLIS folder:

    cd /var/www/intelis
    

    On older installs, type cd /var/www/vlsm instead.

  2. Start the restore:

    intelis restore
    

    The command checks for the current restore script before it runs. If the machine is offline, it uses the installed script.

  3. 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 backups folder, 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 connect

    Check 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.

  4. 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. The Backing up to line shows where they go.

  5. At What should be copied back?, choose An older database backup (choose a date).

  6. 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 yet

    The 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.

  7. 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.ABCDEF
    

    Each restore uses a new folder. Files fetched by an earlier restore cannot be selected by mistake.

  8. 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 restore again and choose another date.

Restore the database

  1. 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.
  2. 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 finish

    If 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 with pre-restore-vlsm- in /var/www/intelis/backups/db (/var/www/vlsm/backups/db on older installs), run it, then contact support with the message shown.

    If it says The database is restored, but its migrations did not finish

    The data is back. Apply the updates by hand:

    intelis migrate
    

Check the lab

  1. Open InteLIS in the browser.
  2. Log in with an administrator account that existed when the backup was made.
  3. Check the lab settings under Admin → Settings → General Configuration.
  4. Open a request entered shortly before the backup, and check its results are there.
  5. If the lab uses the interfacing tool, its database stays as it is. To put it back to the same day too, contact support.

  6. 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

  1. Open a terminal and go to the InteLIS folder:

    cd /var/www/intelis
    

    On older installs, type cd /var/www/vlsm instead.

  2. Start the restore:

    intelis restore
    

    The command checks for the current restore script before it runs. If the machine is offline, it uses the installed script.

  3. 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 backups folder, 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 connect

    Check 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.

  4. 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. The Backing up to line shows where they go.

  5. At What should be copied back?, choose Everything, including uploaded files and attachments.

  6. 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.ABCDEF
    

    Each restore uses a new folder. Files fetched by an earlier restore cannot be selected by mistake.

  7. 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

  1. 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.
  2. Wait for Database restored. The script first saves a safety copy of the current database, then restores the newest backup starting with vlsm-, then applies the database updates.

    If it says The restore did not finish

    If 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 with pre-restore-vlsm- in /var/www/intelis/backups/db (/var/www/vlsm/backups/db on older installs), run it, then contact support with the message shown.

    If it says The database is restored, but its migrations did not finish

    The data is back. Apply the updates by hand:

    intelis migrate
    

Put the uploaded files back

  1. 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"
    
  2. Check what the copy holds:

    ls "$restore_dir/public/uploads"
    
  3. 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.

  4. 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.

  5. Repair the file ownership, so the web server can read the restored files:

    sudo intelis provision
    

Check the lab

  1. Open InteLIS in the browser.
  2. Log in with an administrator account that existed when the backup was made.
  3. Check the lab settings under Admin → Settings → General Configuration.
  4. Open a request entered shortly before the backup, and check its results are there.
  5. Open a result PDF or an attachment, and check it displays.
  6. 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=interfacing
    

    Open 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 with interfacing- onto the terminal window, and press Enter.

    Always keep --profile=interfacing in this command. Without it, the file is restored over the main database.

  7. When the lab works, run the exact cleanup command printed by the script. It removes only this fetched copy, which holds the database password.