NuoDB Migrator Dump Command
The dump
command exports data from an existing NuoDB or 3rd party database.
A data dump file will be created for all tables (or a select number of tables, or a subset of tables) as determined by certain command line options.
Data dump files will be saved in the specified output directory along with a dump metadata description XML file.
Data dump files will only be created for tables that contain data. |
The types of options that are available to the dump
command are:
-
Source database options
Specify the details for the source NuoDB or 3rd party database, such as database connection, login credentials, etc. -
Output file specifications
Specify the format and location for the data dump of the source database. -
Migration mode
Specifies thedump
command mode:
Option | Description |
---|---|
--data=true --schema=true |
|
--data=false --schema=true |
|
--data=true --schema=false |
|
-
Data Dump Result Set
Specify objects, queries, filters, etc. These options will be used to generate a result set of the source data that is to be dumped. These can also specify what data or objects not to dump by setting options to false. -
Schema Options
These options are used if the migration mode includes theschema
command. The specific commands available are listed on theschema
command listing. For more information, see NuoDB Migrator Schema Command.
For dumping large production databases to files, please consult with your NuoDB Professional Services team when considering the best setting for the --source.transaction.isolation=value migrator dump command line option.
This value is specific to the source database vendor JDBC driver properties.
|
Syntax
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 [ option ]...
The following is a list of dump
command line options.
Options related to the source database connection | ||
---|---|---|
Option |
Required |
Description |
--source.driver= |
Yes |
JDBC driver class name |
--source.url= |
Yes |
Source database connection URL in the standard syntax: |
--source.username= |
Yes |
Source database username. |
--source.password= |
No |
Source database password. |
--source.properties= |
No |
Additional connection properties encoded as URL query string, e.g. “ |
--source.catalog= |
No |
Default database catalog name to use |
--source.schema= |
No |
Default database schema name to use |
--source.auto.commit={ true | false } |
No |
If set to |
--source.transaction.
isolation= |
No |
Sets the transaction isolation level for the migration execution.
A valid value can be either a symbolic name or an integer constant representing transaction isolation levels as defined in the JDBC
NuoDB does not support all of the levels, only |
Options related to Output Specification | ||
---|---|---|
Option |
Required |
Description |
--output.type={ csv | xml | bson } |
Yes |
Output type to generate - default is |
--output.path= |
No |
Path on the file system where the output should be generated.
If the |
--output.{csv | xml}. |
No |
Output format attributes.
These are specific to the type of output being generated, as defined by the command line option parameter
For xml, the valid attributes (
|
Migration modes | ||
---|---|---|
Option |
Required |
Description |
--data={ true | false } |
No |
Enables or disables data being dumped. Default is true. |
--schema={ true | false } |
No |
Enables or disables generation of DDL SQL script file to generate schema objects. This enforces the same behavior as running the migrator tool |
Options related to building the data dump result set | ||
---|---|---|
Option |
Required |
Description |
--table= |
No |
Table(s) specified for data to be dumped |
--table.type= |
No |
Comma separated list of types of table objects ( |
--table. |
No |
Selects table rows to be dumped from the table specified as |
--threads= |
No |
Number of concurrent processing threads, defined by |
--query= |
No |
A |
--query.limit= |
No |
Query limit is a maximum number of rows to split a table into chunks with |
--time.zone= |
No |
Time zone enables date columns to be dumped and reloaded between servers in different time zones |
Schema migration commands (supported if command line parameter option --schema=true is used) |
||
---|---|---|
Option |
Required |
Description |
Various |
No |
Various optional |
Usage Examples
Dump from a MySQL Database
The following dump
command creates a dump from a MySQL database in CSV format and saves it to /tmp/dump.cat
.
$ nuodb-migrator dump \
--source.driver=com.mysql.jdbc.Driver \
--source.url=jdbc:mysql://localhost/test \
--source.username=root \
--source.password=12345 \
--output.type=csv \
--output.path=/tmp
Time Zone Option
The user can specify that all DATE
, DATETIME
, and TIMESTAMP
columns can be dumped in a different time zone.
The time zone is instantiated by its identifier, an abbreviation such as PST
or a full name such as America/Los_Angeles
.
nuodb-migrator dump ... --time.zone=UTC+2
Dump Specific Tables
The following dump
commands are identical and tell the migrator to only dump these specific tables.
nuodb-migrator dump ... --table=t1,t2,t3
nuodb-migrator dump ... --table=t1 --table=t2 --table=t3
Dump Subset of Rows
NuoDB Migrator allows the user to dump a subset of rows which match a condition specified with a query_filter
option.
The query_filter
value will be appended as a WHERE
clause to a dynamically generated SELECT
statement, selecting all columns from the table specified.
If the query_filter
contains spaces, it must be enclosed in double quotes. The table_name
is optionally catalog and/or schema qualified.
nuodb-migrator dump ... --table.catalog1.schema1.t1.filter=id>1000
nuodb-migrator dump ... --table.catalog1.t1.filter=id>1000
nuodb-migrator dump ... --table.schema1.t1.filter=id>1000
nuodb-migrator dump ... --table.t1.filter=id>1000