Backup & Restores

I have been using Ralph for a while now and realized I have absolutely no backup plan for this database.

I have looked high and low for documented ‘Best Practices and Procedures’ for backup and restore. But no luck.

Can anyone help with the best way to backup, restore and in a worst case scenario, restore on an entirely new sever. I would really like see Ralph implement either a GUI zip download/restore and also cron daily/week/month backups.

I’ve been backing up the database. From what I gather, everything is stored in the db (minus your certificates and webserver configs, of course).

On a docker host using mysql as the backend, I do the backup via a script:

# rootpass
docker exec -it ${container} bash -c "${binary} --all-databases -u root -p\"${rootpass}\" | tee  /backups/bak.sql"

While I have restored the db from that dump, I haven’t tested a ralph installation with it, but the data seems to be all there.

Naturally, PostgreSQL would be using pg_dump with different syntax, and if you’re not running this on docker, you’d want to remove the docker components. This isn’t a very clever script (I hacked it together in a few minutes) - and I intend to refine it.

to restore using mysql, you could copy the sql dump to a new container and import it. You’d need to create the db if it didn’t already exist with the name ralph_ng