Per a request by @hjpvandijk -- how can you incorporate database instances from a different instance of LogUI server? At the moment, there is no functionality to do this within the LogUI server interface itself. This is something we can include at a later date. For now, you can use Docker magic to achieve this. This solution uses a script available at https://github.com/loomchild/volume-backup.
This process involves restoring two database volumes, one for Postgres, and the other for MongoDB. You'll have two archive files you need to restore. We make use of a prebuilt Docker image to do the intermediary work for us.
To create a backup of the LogUI database volumes for a given instance
Stop the LogUI server instance. As per the Wiki, the default command is $ docker-compose -p logui down from the server directory.
Create a new directory in your filesystem where the two archive files will live. For this example, I'll just create a directory at ~/archive.
Run the following commands to backup the logui_db and logui_mongo volumes. Your current working directory doesn't matter. Replace ~/archive/ with the path to your new directory. This is where the archives will be stored.
docker run -v logui_db:/volume -v ~/archive/:/backup --rm loomchild/volume-backup backup logui_db.tar.bz2
docker run -v logui_mongo:/volume -v ~/archive/:/backup --rm loomchild/volume-backup backup logui_mongo.tar.bz2
You should now have two files in the ~/archive directory. You can move these files to a different host to restore them if you wish.
This process does not delete the databases on the origin host! You can restart LogUI server when this process has been completed.
To restore LogUI database volumes (with backups created from the process above)
Copy the two files created from the process above to a directory on the host you wish to restore the files to. Ensure they live in a directory by themselves; for the examples, we'll be using the ~/archive directory as above. These are expected to be named logui_db.tar.bz2 and logui_mongo.tar.bz2.
Ensure that the LogUI server is set up on your host, and has been fully stopped. Ensure that the two volumes, logui_db and logui_mongo are not present. You can remove them by issuing the commands docker volume rm logui_db and docker volume rm logui_mongo. The restoration commands will recreate these volumes from your backup files.
Run the following commands to restore these volumes from your archives. Your current working directory again does not matter here. Replace ~/archive/ with the path to your temporary directory with the two files you want to restore.
docker run -v logui_db:/volume -v ~/archive/:/backup --rm loomchild/volume-backup restore logui_db.tar.bz2
docker run -v logui_mongo:/volume -v ~/archive/:/backup --rm loomchild/volume-backup restore logui_mongo.tar.bz2
That should be it. You should be able to log in to the LogUI server instance on the host you have restored them to using the username and password you had on the previous host. Applications, flights, sessions, and recorded data should all be available.
This process will be replaced in the future using a more user-friendly approach. If required.
Per a request by @hjpvandijk -- how can you incorporate database instances from a different instance of LogUI server? At the moment, there is no functionality to do this within the LogUI server interface itself. This is something we can include at a later date. For now, you can use Docker magic to achieve this. This solution uses a script available at https://github.com/loomchild/volume-backup.
This process involves restoring two database volumes, one for Postgres, and the other for MongoDB. You'll have two archive files you need to restore. We make use of a prebuilt Docker image to do the intermediary work for us.
To create a backup of the LogUI database volumes for a given instance
Stop the LogUI server instance. As per the Wiki, the default command is
$ docker-compose -p logui down
from theserver
directory.Create a new directory in your filesystem where the two archive files will live. For this example, I'll just create a directory at
~/archive
.Run the following commands to backup the
logui_db
andlogui_mongo
volumes. Your current working directory doesn't matter. Replace~/archive/
with the path to your new directory. This is where the archives will be stored.~/archive
directory. You can move these files to a different host to restore them if you wish.This process does not delete the databases on the origin host! You can restart LogUI server when this process has been completed.
To restore LogUI database volumes (with backups created from the process above)
Copy the two files created from the process above to a directory on the host you wish to restore the files to. Ensure they live in a directory by themselves; for the examples, we'll be using the
~/archive
directory as above. These are expected to be namedlogui_db.tar.bz2
andlogui_mongo.tar.bz2
.Ensure that the LogUI server is set up on your host, and has been fully stopped. Ensure that the two volumes,
logui_db
andlogui_mongo
are not present. You can remove them by issuing the commandsdocker volume rm logui_db
anddocker volume rm logui_mongo
. The restoration commands will recreate these volumes from your backup files.Run the following commands to restore these volumes from your archives. Your current working directory again does not matter here. Replace
~/archive/
with the path to your temporary directory with the two files you want to restore.That should be it. You should be able to log in to the LogUI server instance on the host you have restored them to using the username and password you had on the previous host. Applications, flights, sessions, and recorded data should all be available.
This process will be replaced in the future using a more user-friendly approach. If required.