Database backup refers to the process of creating and storing copies of a database in order to protect it from data loss or corruption. It is important for several reasons:
- Data Protection: Database backup ensures that valuable data is protected and can be restored in case of accidental deletion, hardware failure, or other disasters.
- Business Continuity: Having database backups allows businesses to recover quickly from data loss incidents and minimize downtime, ensuring uninterrupted operations.
- Compliance Requirements: Many industries and regulatory bodies have specific data retention and backup requirements that organizations must adhere to. Database backup helps meet these compliance standards.
- Version Control: Database backups provide the ability to revert to previous versions of the database, which can be useful for troubleshooting, testing, or undoing unintended changes.
- Disaster Recovery: In the event of a major catastrophe, such as a fire or natural disaster, database backups are essential for rebuilding the infrastructure and recovering critical data.
By regularly performing database backups and storing them securely, organizations can safeguard their data and ensure the integrity and availability of their databases.
In the following list you can find several usable open-source backup solutions and scripts that can aid you in backing and restore your database.
1- SubstituteX: A Small simple SQL Database Backup Tool
This is a simple yet powerful tool that aids DevOps and Database admins to back up their SQL data with one click.
It supports scheduled backup, and update intervals, and SQL server authentication.
TidyBackups allows for automation of deletion of Microsoft SQL backup files based on file type (.bak) creation age as well as compression using standard ZIP technology.
3- Database Backup Manager
This is a small productive tool that allows you to automate your backup of Microsoft SQL database into a single backup file (.bak).
4- Craft-Scripts (CraftCMS Backup)
Shell scripts to manage database backups, asset backups, file permissions, asset syncing, cache clearing, and database syncing between Craft CMS environments.
Onedump is a database dump and backup tool that can dump different databases to different storage with a simple configuration file or CLI commands.
- Database backup from different sources to different destinations.
- Load configuration from S3 bucket.
- Compression (use
job.gzip: trueto enable compression).
- Unique filename (use
job.unique: trueto enable unique filename).
- Slack notification.
- Maintained docker image.
- Supported drivers: MySQL, PostgreSQL
- Supported storage: Local, S3, Google Drive, Dropbox
6- pgbackup - Automated PostgreSQL Backup on Linux
This is an automated PostgreSQL Backup on Linux.
7- SQL Dumper
A PHP command line application to dump databases into your source code. This can be very useful if you need to version control your database along with the source code.
This tool is written by PHP. If your website is also written by PHP, then using this tool does not require additional environment requirements. (The version requirements are described in Compatibility section below)
This tool supports both physical and logical backups. Due physical backup just is file copy, so the backup method supported all databases. However the logical backup only supports MySQL (and MariaDB), in the future will support more databases.
This tool also supports both local and remote storage. The support storage way is detailed below.
9- Auto-Upload (MySQL)
This script can be used as crone job of Linux to take backup for the MySQL database. Users need to do some modification according to their use.
mongo-dumper is a simple CLI script to easily dump, compress, encrypt and optionally upload your mongodb database/cluster. The tool is using the --archive and optional the --gzip option from mongodump to create a backup. Keep this in mind if you restore your backup with mongorestore.
11- pg-dumper (Postgres SQL)
pg-dumper is a simple cli script to easily dump, compress, encrypt and optionally upload your postgres database/cluster.
12- Docker DB Backup
This open-source free tool helps you to build a container for backing up multiple types of DB Servers
Currently backs up CouchDB, InfluxDB, MySQL, MongoDB, Postgres, Redis servers.
- dump to local filesystem or backup to S3 Compatible services, and Azure.
- select database user and password
- backup all databases, single, or multiple databases
- backup all to seperate files or one singular file
- choose to have an MD5 or SHA1 sum after backup for verification
- delete old backups after specific amount of time
- choose compression type (none, gz, bz, xz, zstd)
- connect to any container running on the same system
- Script to perform restores
- Zabbix Monitoring capabilities
- select how often to run a dump
- select when to start the first dump, whether time of day or relative to container start time
- Execute script after backup for monitoring/alerting purposes
13- Laravel Backup Backup
Backup is a Laravel package that allow the creation and restoration of database backups in an easy way.
14- XCloner WordPress Plugin - Backup and Restore
This open-source free tool helps you to back up your WordPress site, restore to any web location, send your backups to Dropbox, Amazon S3, Azure, FTP, SFTP and many others with XCloner backup plugin.
XCloner is a Backup and Restore plugin that is perfectly integrated with WordPress.
XCloner design was specifically created to Generate custom backups of any LAMP website through custom admin inputs, and to be able to Restore the clone on any other location with the help of the automatic Restore script we provide!
XCloner Backup tool uses Open Source standards like TAR, Mysql and CSV formats so you can rest assured your backups can be restored in a variety of ways, giving you more flexibility and full control.
- Backup and Restore your WordPress site easily
- Create compressed and uncompressed backups using TAR open source format
- Create encrypted backups archives with AES-128-CBC algorithm
- Create automated backups from your Scheduled Backups Section
- Received email notifications of created backups
- Generate automatic backups based on cronjobs, it can run daily, weekly, monthly or even hourly
- Restore your backups on any other location, XCloner will attempt to extract the backup archive files for you, as well as import the mysql dump and update the WordPress config details
- Upload your backups to Remote Storage locations supporting FTP, SFTP, Dropbox, AWS, Azure Blob and many more to come
- Watch every step of XCloner through it's built in debugger
- Although we have optimized XCloner to run properly on most hosts, we give Developers options to customize its running speed and avoid backup timeouts, all from the XCloner Config-> System Options
- Ability to split backups into multiple smaller parts if a certain size limit is reached
This script takes the MySQL or MariaDB database backups of multiple Laravel apps as SQL files. Define the project
depth in .env file and run the script as a cron job.
16- Magedbm2 - A Database Backup Manager
Magedbm2 is a database backup manager designed to make the process of taking backups from one environment and moving them to another, easy. The backups can be stripped of sensitive tables and can even generate anonymized versions of the sensitive data. While it was originally developed to for Magento 2.x it can be used for any system.
It was written with developers in mind and provides commands for:
- Creating sanitised (or unsanitised) production database backups and uploading them to Amazon S3
- Downloading and importing existing backups to development or staging environments
- Exporting and importing anonymised sensitive data tables
It's a DB dump tool which will create a backup from source database, then will zip the backup file and upload it to GCS or AWS bucket, finally will restore the data to destination server.
- Creates backup from production database
- Loads backup SQL file to staging database
- virtnbdbackup https://github.com/abbbi/virtnbdbackup