I would like to keep an on-premises backup instance of my cloud deployment for disaster recovery and testing purposes.
To accomplish this, I have been attempting to restore to the local instance using the duplicity backup files stored in S3, but am running into an issue with path differences between the environments.
Steps I have taken so far and tested successfully:
- Created Ubuntu Xenial VirtualBox VM similar to the old OpenEMR Appliance.
- Installed OpenEMR v6.0.0 Lightsail instance on VM using launch.sh.
- Scripted a download of the duplicity backup files from S3 using AWS CLI, placing them in /root/backups (where local backups would go).
- Configured the gnupg decryption that duplicity needs to use during recovery.
- Modified restore.sh so that duplicity does decryption on the files, even though it is not a cloud instance.
The issue I’m having at this point is that when duplicity expands the backup files, it does so to the same absolute path that they were backed-up from. So during recovery, the cloud files are expanded into /mnt/docker when they need to go into /var/lib/docker.
A couple questions:
Is there a better strategy for my use case (backup cloud, restore local) that people are using?
I’m not sure why the cloud deployment is mounting /mnt/docker and using it as a symlink source for /var/lib/docker - something to do with EBS I’m sure. Could that be replicated on a local Lightsail instance somehow? Is there another workaround for this, perhaps just moving /mnt/docker to /var/lib/docker after the duplicity operation in restore.sh?
These are probably questions for @jesdynf who put in the effort on these mechanisms, but I would appreciate any advice.
Finally, in case it might save anyone some time… I attempted to install a Lightsail instance within a Sysbox Docker container (the whole docker inside docker thing). It can be installed and run just fine, but Sysbox treats /var/lib/docker specially, and problems occur when the OpenEMR backup/restore process starts mucking with the Docker volume mounts there.