Backup Recovery

I wanted to make a top-level post about this because I just finished a tool for Lightsail that’s actually broadly relevant to a lot more than just backup recovery.

openemr-devops/ingestion.sh at master · openemr/openemr-devops · GitHub is a script designed to eat an OpenEMR backup – the combined tarball that the backup facility creates – and load it into Lightsail. The scope of what it actually does is fairly limited – it processes the SQL log, it fishes out the (single) sites directory to find the patient documents, it modifies the sqlconf to better fit the new environment, and that’s just about all it restores.

However, it’s serving several goals and I encourage you to review it.

  • It’s demonstrating one way to load the SQL script from the command line without needing to go through phpMyAdmin, relying on Docker’s environment to pass on the credentials it needs.
  • Examples of how to copy files and directories into and out of the docker container are provided.
  • Running a complicated script inside the docker is illustrated with a heredoc instead of having to copy a file into the docker and then run it.
  • ingestion is designed to work with Lightsail in particular but it can be made to work with any containerized OpenEMR installation, probably. Either your own docker-compose install or the AWS specialties; even Standard could be made to work, probably.
  • In that vein, this isn’t just a recovery tool – this is a migration tool to allow a practice hand-configured locally to migrate to either a cloud solution or just a rebuilt containerized environment in the same place.
  • A vendor with patches they want to apply to OpenEMR could use ingestion as a template to apply these changes during installation.
  • Alternately, ingestion could be expanded to find your modified modules or templates and copy them over as well as the patient files.

It’s a short script and I encourage anybody who’s been on the fence about Docker, or been unsure how to interact with it, to glance at it.

(*) Note that this doesn’t have anything to do with the recent work on Express Plus recovery orchestration; those backups are system-level backups that aren’t the same thing as the backup OpenEMR creates for you to download.

5 Likes