Self hosted database backup tool reddit / selfhosted ---------------------------------------------------------------------- MycoApps · 2023-12-23 14:45 Hi everyone, we've been looking for database backup tools that we can self-host, with some scheduled backup features as well as a history of backups, results, notifications etc. We couldn't find anything that has all of this in one place and we were thinking into building ourselves something like this? We're trying to get some insights before starting building it (or maybe reasons why not to do it). Do you know some self hosted service that does this? Would you install something like this or the command line is enough? What would be some functionalities that you'd like the app to have? ---------------------------------------------------------------------- josemcornynetoperek · 2023-12-23 15:10 I made on python for myself tool based on xtrabackup, minio and cron. It is simple way to backup whole or selected database and restore it. Minio is great solution for storage, because of retention. ---------------------------------------------------------------------- ttkciar · 2023-12-23 15:13 Command line tools are fine for this. Git + mysqldump + cron will do almost all of what you describe. ---------------------------------------------------------------------- lytn1ng · 2023-12-23 16:08 Check out Bacula. It can backup more than databases - on specified schedules, and with results, notifications, lists of files etc. I wrote a series at https://www.lytning.org/ - including backing up a MariaDB database (using a mysqldump script), as well as setting up a UI (Bacularis). I might also post soon about configuring email notifications in Bacula. ---------------------------------------------------------------------- madroots2 · 2023-12-23 16:16 Pipelinewise. Very easy to setup and works magic. ---------------------------------------------------------------------- josemcornynetoperek · 2023-12-23 16:19 mysqldump lock table during dump ---------------------------------------------------------------------- ttkciar · 2023-12-23 16:52 No, not with `--single-transaction=TRUE --lock-tables=FALSE`. ---------------------------------------------------------------------- josemcornynetoperek · 2023-12-23 16:53 Do it on larger than 20gb database used by something 😎 ---------------------------------------------------------------------- ttkciar · 2023-12-23 17:04 Where did OP state the size of their database? ---------------------------------------------------------------------- josemcornynetoperek · 2023-12-23 17:05 Nowhere, i count only that isn't good idea with large databases. ---------------------------------------------------------------------- Popcorncandy09 · 2023-12-23 17:11 Your website doesn’t load. ---------------------------------------------------------------------- linuxmel · 2023-12-23 17:27 Why not use mysqldump with cronjob ? Or a batch script. ---------------------------------------------------------------------- blind_guardian23 · 2023-12-23 18:11 maybe my ansible role for bacula is also interesting (might add bacularis later): [https://github.com/selfhostx/ansible/tree/main/roles/bacula](https:// github.com/selfhostx/ansible/tree/main/roles/bacula) or this for mysqldump: https://github.com/stefanux/ansible-mysqlbackup ---------------------------------------------------------------------- michaelpaoli · 2023-12-23 18:53 First of all you have to know how you can backup your database. There are some options: * cold - database fully down - you back up all the relevant files (including any "raw" storage) * if the database supports it (most do), hot backups - there are generally specific procedures that have to be done to be able to do and have a backup that can actually be restored * exports, etc. One can dump/export data, and use that for the backups ... however may have to dump additional data or metadata, etc., notably to be able to fully, usefully, and easily restore. If there are applicable procedures for this, and what they are or may be, will vary by database type. So ... can start from there ... and depending what the backup needs ... most notably if it's anything other than cold backups, will generally want/need something that plays nice with the database and proper means to safely and usefully back it up. You didn't mention what database or operating system, so ... details will of course quite vary depending upon that. ---------------------------------------------------------------------- KervyN · 2023-12-23 21:12 Sorry for the stupid question, but what will happen? I only use postgres and there is no problem with huge DBs and dumping. ---------------------------------------------------------------------- lytn1ng · 2023-12-24 02:37 That's weird. I checked before replying here, and just now too. Are you getting some error? ---------------------------------------------------------------------- lytn1ng · 2023-12-24 02:40 I haven't played (yet) with ansible (or Chef or Salt...). So, unfortunately, I have nothing to add on this topic. ---------------------------------------------------------------------- blind_guardian23 · 2023-12-24 07:07 Thats ok, would recommend looking into ansible, its the "docker" of automation i would say. Mailrelay does take care of email too: https://github.com/selfhostx/ansible/tree/main/roles/mailrelay For me its easier to read back the tasks of ansible instead writing documentation with all commands and edits. ---------------------------------------------------------------------- Popcorncandy09 · 2023-12-24 09:38 It loads now but before it was getting timeout ---------------------------------------------------------------------- lytn1ng · 2023-12-24 16:59 It's on my list of things to do. Thanks for the pointers related to Bacula and email alerts too. ---------------------------------------------------------------------- lytn1ng · 2023-12-24 17:00 Thanks for checking it out and also updating here. Hope you find something useful there. ---------------------------------------------------------------------- blind_guardian23 · 2023-12-24 20:01 feel free to ask if you have questions (contacts are on github) and the "ansible galaxy" has more.