Context:
Each time a demo branch is built, I want to download a copy of the prod database and setup it onto the demo server. This way under the MySQL I have X database corresponding to X demos.
I achieved it using the mysql_import
but it takes 3 ~ 5 minutes when importing the DB. So to speed up I wanna use Xtrabackup
.
Problem:
The problem is that during the full backup, xtrabackup copies all the necessary files and also the ib_logfile
files.
So let's say I want to import the database into database named demo_1874
.
- I do a full backup of the database, then I run
--prepare
twice on the same server, and I compress the result. - Download on the other server, uncompress all the backup files
- Paste them under
/var/lib/mysql
which will override the other files (ib_logfile
) - Rename the folder
original_db
todemo_1874
Question
By copying files like
ib_logfile
, will it break all the other databases I have on this MySQL server (which I don't want this to happen) ?What are the other options using Xtrabackup to import a database among others without altering the others ?
ib_logfile
from the server A into the server B which has different databases. Even if the server is stopped, it will corrupt the other databases no ?