Login Enterprise backup and recovery

Overview

External database

Internal database

Overview

You can migrate the database from a malfunctioning Login Enterprise instance to a functional one, preserving your data and configuration. Please note that encrypted data, such as user passwords and application secrets, may not be transferred, but your overall configuration will remain intact.

This article outlines the process for creating a backup of the internal database to facilitate restoration on a rebuilt Appliance. Additionally, it provides instructions on how to configure a new Appliance to connect to an existing external database and recover configurations.

External database

If you still have access to the original Appliance, the best way to reconnect to your external database is to back up and restore your internal database. The database connection information is stored on the Appliance itself, so restoring the Appliance data will also restore access to the external database. If possible, use the Internal Database instructions below.

Otherwise, you can simply set up a new Appliance and configure it to connect to the existing database. Avoid directing two Appliances to the same database simultaneously. If you need to replace an Appliance, it's straightforward to create a new one and configure it to use the existing database. Please contact Support for additional information about cleaning up encrypted data.

Internal database

For the internal database, it's easiest if you can obtain a copy of the database before your Appliance VM becomes inaccessible. Otherwise, it may be possible to get the data files from the boot disk by attaching it to another VM.

You must ensure that all the Login Enterprise services are stopped before proceeding with the following steps:

1. Log in to the Appliance with the admin account, go to Troubleshooting, and open the Bash shell.

2. loginvsid stop

3. systemctl stop docker

4. cd /home/admin

5. tar -zcvf data.tgz /loginvsi/data /var/lib/docker/swarm /loginvsi/.env /certificates /usr/local/share/ca-certificates /home/admin/LE_key

6. Download /home/admin/data.tgz to some other machine. Use tar to ensure proper preservation of file permissions and ownership.

To install the database on a new Appliance, follow these steps:

7. Upload data.tgz to /home/admin on the new Appliance

8. loginvsid stop

9. systemctl stop docker

10. cd /

11. rm -rf /loginvsi/data /var/lib/docker/swarm

12. tar -zxvf /home/admin/data.tgz

13. nano /loginvsi/.env

14. Stop here and update the ALLOWED_CLIENT_URLS field in the .env file to reflect your current IP address and/or hostname. You will be unable to start the services if ALLOWED_CLIENT_URLS is wrong. Save and exit the editor. Then:

15. update-ca-certificates

16. loginvsid restart

After logging back into the Login Enterprise, your data and configurations will be automatically restored.

Note that you can clone an Appliance in this way, too. If you are using the internal database, you can restore an Appliance to multiple VMs, and they will not conflict. Note that your Launchers and Test Users need to be restricted to a single Appliance. Multiple Appliances cannot share Launchers or users.