I am trying to copy our production database, to a staging database on the same server without locking up our production application.

Our databases on MariaDB (10.1.22-MariaDB-1~xenial) have become too large to export with mysqldump. Doing this on production locks the tables and brings our application down. I am using the new mariabackup tool which is a fork of the Percona XtraBackup tool. It seemed to work fine with the following command:

sudo mariabackup --user=<me> --password=<something> --databases=crs_production --backup --export

It has left me with a crs_production directory (the name of our database) and bunch of files within it. I assume these are the same files you find in /var/lib/mysql/crs_production.

Am I safe to copy these and overwrite our staging database located at /var/lib/mysql/crs_staging? I am not super concerned with losing staging, but I am super concerned with cratering our database server in the process.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.