mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
5c5ea59bf8
There are two options when coping S3 tables with mysqldump (there is startup option --copy_s3_tables, boolean, default no) 1) Ignore all tables with engine S3, as the data is already safe in S3 and any computer where you restore the backup will automatically discover the S3 table. 2) Copy the table as a normal table with the following 2 changes: - Change ENGINE=S3 to ENGINE=ARIA; - After copy add to log 'ALTER TABLE table_name ENGINE=S3'
33 lines
996 B
Text
33 lines
996 B
Text
--source include/have_s3.inc
|
|
--source create_database.inc
|
|
|
|
create table t1 (pk int primary key, a int);
|
|
insert into t1 values (1,1),(2,2),(3,3),(4,4);
|
|
alter table t1 engine=S3;
|
|
|
|
--echo #####
|
|
--echo # mysqldump with --copy-s3-tables=0 (by default)
|
|
--echo ###
|
|
--exec $MYSQL_DUMP --compact $database
|
|
--echo #####
|
|
--echo # mysqldump with --copy-s3-tables=0 (by default) XML
|
|
--echo ###
|
|
--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]{2})*/--TIME--/
|
|
--replace_result $database database
|
|
--exec $MYSQL_DUMP --compact -X $database
|
|
--echo #####
|
|
--echo # mysqldump with --copy-s3-tables=1
|
|
--echo ###
|
|
--exec $MYSQL_DUMP --compact --copy-s3-tables=1 $database
|
|
--echo #####
|
|
--echo # mysqldump with --copy-s3-tables=1 XML
|
|
--echo ###
|
|
--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]{2})*/--TIME--/
|
|
--replace_result $database database
|
|
--exec $MYSQL_DUMP --compact --copy-s3-tables=1 -X $database
|
|
|
|
drop table t1;
|
|
#
|
|
# clean up
|
|
#
|
|
--source drop_database.inc
|