{question}
What are the methods to move large tables across clusters?
{question}
{answer}
In this article, we are going to discuss methods to move large tables between clusters. For example, this kind of operation is may be required for moving tables between a Production cluster and a Development cluster for testing purposes.
The straightforward method to achieve this is to use mysqldump. Click the below link for the mysqldump procedure:
mysqldump for export and import of single table
Another method is to use the sdb-admin dump, click here to learn more about it.
The above methods Generate a sequence of SQL statements that can be executed to reproduce the objects. It's the recommended method to move database objects, but It's slow for larger tables.
Below are the alternative methods that can be used for moving a large table,
Method 1:
- Create a New Database.
- Copy the desired table to the new database using INSERT INTO... SELECT... FROM.
- The new database will have that desired table, BACKUP that new database, and RESTORE it into the selected cluster.
Method 2:
- Create a New Database.
- Copy the desired table to the new database using INSERT INTO... SELECT... FROM.
- Instead of BACKUP and RESTORE. Setup the Replication Data Across Cluster for this new database alone.
{answer}