Dumping a Source Database to be Migrated
nuodb-migrator dump
exports the source database data in a format specified by the nuodb-migrator dump
command option --output.type
(e.g. --output.type=CSV
).
This process will also generate an XML file that defines the metadata of the source database.
By default, nuodb-migrator dump
will export table data and all column and table constraints, including default values, column "On Update" defaults (MySQL only), not null, primary key, foreign key and check constraints.
nuodb-migrator dump
will also export sequence objects owned by the source database schema.
The following nuodb-migrator dump
command will migrate most source database schemas.
nuodb-migrator dump \
--source.driver=source_driver_class_name \
--source.url=jdbc:source_jdbc_url \
--source.schema=my_schema \
--source.username=userid \
--source.password=passwd \
--output.type=csv \
--output.path=path_for_dump_files
For MySQL, replace --source.schema=my_schema
with --source.catalog=my_schema
.
To improve load performance when migrating a large database, first migrate the data without indexes, and then migrate the indexes.
The following command will eliminate indexes from nuodb-migrator dump
.
nuodb-migrator dump \
--source.driver=source_driver_class_name \
--source.url=jdbc:source_jdbc_url \
--source.schema=my_schema \
--source.username=userid \
--source.password=passwd \
--output.type=csv \
--output.path=path_for_dump_files \
--meta.data.primary.key=false \
--meta.data.foreign.key=false \
--meta.data.index=false
The nuodb-migrator schema
command will generate Data Definition Language (DDL) SQL scripts to create all indexes.
See Generating DDL SQL Statement Scripts for Migrated Data on how to migrate only indexes.
If the source database is live with on-going updates, it is recommended that the transaction isolation level for the source JDBC connection be set to maintain a consistent read of the database while nuodb-migrator dump
is processing.
This value is dependent on the JDBC driver used. An example of setting this is:
nuodb-migrator dump \
--source.driver=source_driver_class_name \
--source.url=jdbc:source_jdbc_url \
--source.schema=my_schema \
--source.username=userid \
--source.password=passwd \
--output.type=csv \
--output.path=path_for_dump_files \
--source.transaction.isolation=serializable