Migrating From PostgreSQL
Postgres JDBC Driver Information
Download a required version of PostgreSQL Native Driver.
Supported Driver |
|
Class Name |
|
JDBC URL |
|
| PostgreSQL provides a type 4 JDBC driver. Type 4 indicates that the driver is written in pure Java, and communicates in the database system’s own network protocol. Because of this, the driver is platform independent; once compiled, the driver can be used on any system. For additional information, see PostgreSQL Driver. |
Migration Commands
nuodb-migrator schema
The following sample generates a NuoDB schema from a PostgreSQL db1 database public schema and stores that in /tmp/schema.sql:
$ nuodb-migrator schema \
--source.driver=org.postgresql.Driver \
--source.url=jdbc:postgresql:db1 \
--source.username=postgres \
--source.password=postgres \
--source.schema=public \
--output.path=/tmp/schema.sql
The nuosql command line tool can load the dumped schema file.
This command will load the dumped schema into the NuoDB db2 database into the schema test2.
$ nuosql db2@localhost --user cloud --password user --schema test2 --file /tmp/schema.sql
nuodb-migrator dump
To create a dump from the PostgreSQL db1 database tables from the public schema in CSV format to --output.path directory execute:
$ nuodb-migrator dump \
--source.driver=org.postgresql.Driver \
--source.url=jdbc:postgresql:db1 \
--source.username=postgres \
--source.password=postgres \
--source.schema=public \
--output.type=csv \
--output.path=/tmp/dump
nuodb-migrator load
To restore the previously created dump to a NuoDB database in the schema specified by --target.schema run nuodb-migrator load:
$ nuodb-migrator load \
--target.url=jdbc:com.nuodb://localhost/db2 \
--target.schema=test2 \
--target.username=cloud \
--target.password=user \
--input.path=/tmp/dump