- Does not support partitioned tables
Prerequisites:
- Make sure that on the destination DB
innodb_force_recovery
is undefined or set to 0 otherwise errors about "read only" tables will interrupt import process
Steps to make partial backup & restore:
- Copy
config.sample.php
toconfig.php
and edit with proper data; - On the SOURCE server make next steps:
- Make partial backup using mariabackup, eg.
mariadb-backup.exe --backup --target-dir=c:\TEMP\mariadb\ --user=root --password=... --databases="... ..."
- Prepare data export, eg.
mariadb-backup.exe --prepare --export --target-dir=c:\TEMP\mariadb\
- Generate SQL for database and table recreating:
mysqldump.exe -u root -p --no-data --databases ... ... > c:\TEMP\mariadb\recreate_databases_and_tables.sql
- Generate SQL for tablespace discarding and tablespace importing:
php tablespace.php
- Now switch to DESTINATION server and make next steps
- Run SQL for generating databases and tables and then SQL for tablespace discarding
- Stop the DB service
- Copy ONLY folders (DO NOT COPY loose files) from your backup/export dir to destination folder
- Start the DB service
- Run SQL for tablespace importing
Tablespace SQLs might throw errors. At this time you should execute them row by row and correct obvious problems.