How can i load a database backup?

I’m still thinking about a good database backup strategy with cleavr.
As I read in the docs, i know how to backup a database, but how can i load a backup (MySql?).

Can’t find anything.

Thx for your great support!

All the best
Tobi

Hey @Tobi,

For ourselves, we typically use a database client to manage database restores - such as TablePlus.

It’s pretty straightforward to restore a db with TablePlus.

In the future we’d like for Cleavr to also be able to handle restoring a db from a backup.

Thanks for mentioning the docs - we don’t really cover the restore parts in the docs, just the backup parts which is just half the puzzle. I’ll work on updating the docs to make it more clear and to provide some examples.

1 Like

Any updates for this topic? Especially for backup and restore a strapi MySQL db

1 Like

Hi @Tobi, thanks for asking!

Our product road map over the next couple of months will be heavily focused on bug fixes and smaller feature enhancements and new features. Restoring a database from backup is a fairly large undertaking that we’ll likely look more into sometime in later Q3.

Have there been any changes regarding this?

I guess not, I use a linux tool for database backups. There is still no restore feature, but you can import this backup files directly via phpmyadmin. This are steps I do on my servers:

Install automysqlbackup and create these settings

apt-get install automysqlbackup
nano /etc/default/automysqlbackup

Change the path into
BACKUPDIR="/home/cleavr/automysqlbackup"

If you installed MySQL8 (instead of MariaDB) add the file /etc/mysql/debian.cnf with the following code:

[client]
host     = localhost
user     = root
password = THEROOTPASSWORD
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = root
password = THEROOTPASSWORD
socket   = /var/run/mysqld/mysqld.sock

If you don’t have a root password, create the phpmyadmin app in Cleavr and use the credentials from that installation.

Run once automysqlbackup

Add this cronjobs for the root user to remove monthly backups older than 3 months.
0 0 2 * * find /home/cleavr/automysqlbackup/monthly/* -mtime +90 -delete

2 Likes