Overview of GaussDB Migration Solutions
You can migrate data from MySQL, PostgreSQL, Oracle, DB2 for LUW, RDS for SQL Server, or Microsoft SQL Server databases to GaussDB, or from one GaussDB instance to another GaussDB instance.
Data migration tools include DRS, DAS, and gs_loader. You are advised to use DRS because it is easy to use and can complete a migration task in minutes. GaussDB migration service helps you reduce DBA labor costs, hardware costs, and data transmission costs.
Data migration tools include gs_dump, gs_dumpall, gs_restore, copy commands, and CopyManager.
Solution |
Data Source |
Description |
Reference |
---|---|---|---|
Using DRS to import data to GaussDB |
MySQL |
Real-time data synchronization of DRS allows you to copy data from a data source to GaussDB to implement real-time data flow of key services. It focuses on the synchronous import of tables and data. |
|
Oracle |
|||
GaussDB (distributed deployment) |
|||
GaussDB (centralized deployment) |
|||
DB2 for LUW |
|||
PostgreSQL |
|||
SQL Server |
|||
Using DAS to export and import data |
SQL/CSV files |
You can use DAS to export data from the source database first and then import the data from your local PC or OBS bucket to the destination database. |
Migrating Data to GaussDB Using the Export and Import Functions of DAS |
Using the copy to/from command to export and import data |
CSV files |
The gsql tool provides the \copy meta-command to import or export data. \copy applies only to small-scale data import in good format. It does not preprocess invalid characters or provide error tolerance. Therefore, \copy cannot be used in scenarios where abnormal data exists. |
|
Using CopyManager in JDBC to export and import data |
Other files or databases |
When you use Java to develop applications, the CopyManager interface of the JDBC driver is invoked to write data from files or other databases to GaussDB. |
|
Using gs_dump and gs_dumpall to export data |
|
gs_dump can export a single database or its objects. gs_dumpall can export all databases or global objects in a cluster. You can use a tool to import the exported metadata to a target database for database migration. |
|
Using gs_restore to import data |
SQL/TMP/TAR files |
During database migration, you can use gs_restore to import files exported by gs_dump to GaussDB. In this way, metadata, such as table definitions and database object definitions, can be imported. The imported data includes:
|
|
Using gs_loader to import data |
CSV files |
You can use gs_loader to import the files exported by using the copy to command. The gs_loader tool converts the syntax supported by control files into \copy syntax, then leverages the existing \copy function to import main data. At the same time, gs_loader logs the results of the \copy operations to a log file. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot