Over a million developers have joined DZone.

OrientDB Teleporter: Making Migrations Easier (Part 2)

Want to move your database to a graph-based system? OrientDB's Teleporter makes that easy. See the supported databases and learn the code that makes it tick.

· Database Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database. Try it now! Brought to you in partnership with MongoDB.

This article is a step by step guide on how use Teleporter to migrate and synchronize your database with OrientDB.

If you are interested in a detailed description of the tool, of its inner workings and features, please read the previous post or the official documentation.

In short, OrientDB Teleporter is a tool that synchronizes an RDBMS to an OrientDB database. You can use Teleporter to:

  • Import your existing RDBMS to OrientDB.

  • Keep your OrientDB database synchronized with changes from the RDBMS. In this case, the database on RDBMS remains the primary one and the database on OrientDB a synchronized copy. Synchronization is one way, so all the changes in the OrientDB database will not be propagated to the RDBMS.

This means that the first execution process performs a migration from scratch, whereas all subsequent migrations on the same target OrientDB graph database carry out a synchronization between your source database and OrientDB.

This dual behavior is transparent to the user who will always follow the same procedure.

Teleporter is fully compatible with several RDBMS that have JDBC drivers: We successfully tested Teleporter with Oracle, SQLServer, MySQL, PostgreSQL and HyperSQL. Teleporter manages all the necessary type conversions between the different DBMSs and imports all your data as a Graph in OrientDB.

This tool is really easy to use thanks to a completely automatic and clear execution, which requires a few important parameters. At the same time, it’s possible to enrich the migration process by specifying different strategies and customizations which allow you to obtain more refined results.

Now let’s start from the simplest migration case. First of all, you can invoke the tool through  the oteleporter.sh (Unix and OS X platforms) or oteleporter.bat (Windows platforms) scripts. Then you must type 3 mandatory arguments to begin your import:

  • -jdriver: the driver name of the DBMS from which you want to execute the import.

  • -jurl: the JDBC URL giving the location of the source database to import.

  • -ourl: the URL for the destination OrientDB graph database.

If credentials are required to access your source database, you have to type two more arguments:

  • -juser: is the username to access the source database.

  • -jpasswd: the password to access the source database.

Thus, in this case, the generic call to Teleporter looks like this:

 oteleporter.sh -jdriver <jdbc-driver> -jurl <jdbc-url> -juser <username> 
                -jpasswd <password> -ourl <orientdb-url>

All other parameters are optional: now let’s start with a standard migration from each compatible DBMS.

When you specify the DBMS you want to connect with through the argument -jdriver, you must choose amongst the following values:

  • Oracle

  • SQLServer

  • MySQL

  • PostgreSQL

  • HyperSQL

N.B.: The driver identification is not case sensitive, so you may also type  “oracle,” “sqlserver,” etc.

Migration and Sync With Your Database

Let’s suppose we want to import the source database “source-db”  into an OrientDB graphDB called “myTargetDB” and that the source database relies on our local machine with credentials admin|admin.

Depending on our specific DBMS we’ll type the different commands reported in the following table:






oteleporter.sh -jdriver Oracle

                    -jurl jdbc:oracle:thin:@localhost:1521:xe  

                    -juser admin -jpasswd admin

                    -ourl /ORIENTDB_HOME/databases/myTargetDB



oteleporter.sh -jdriver SQLServer

-jurl jdbc:sqlserver://localhost:1433;databaseName=source-db

-juser admin  -jpasswd admin

-ourl /ORIENTDB_HOME/databases/myTargetDB




oteleporter.sh -jdriver MySQL

                      -jurl jdbc:mysql://localhost:3306/source-db

                      -juser admin -jpasswd admin

                      -ourl /ORIENTDB_HOME/databases/myTargetDB



oteleporter.sh -jdriver PostgreSQL

                     -jurl jdbc:postgresql://localhost:5432/source-db

                     -juser admin -jpasswd admin

                     -ourl /ORIENTDB_HOME/databases/myTargetDB


a)  jdbc:hsqldb:hsql://<HOST>/<DB>

    (connection to a database server)

b)  jdbc:hsqldb:file:<filepath>,


    jdbc:hsqldb:res:<package name>

    (connection to a resource)

oteleporter.sh -jdriver HyperSQL
                    -jurl jdbc:hsqldb:hsql://localhost/source-db
                    -juser admin -jpasswd admin
                    -ourl /ORIENTDB_HOME/databases/myTargetDB

(*) If the source database contains spaces in the name you have to use a URL like this:

“Source DB” →  -jurl “jdbc:sqlserver://localhost:1433;databaseName={Source DB};”

Next, we must simply wait for the process to end.

Migration With Optional Parameters

If you want to enrich the migration process from your specific DBMS with optional parameters, you just have to type them following the syntax described in the documentation and in the previous post.

Here, I report the complete command syntax:

./oteleporter.sh -jdriver <jdbc-driver> -jurl <jdbc-url> -juser <username> 
                 -jpasswd <password> -ourl <orientdb-url> [-s <strategy>]
                 [-nr <name-resolver>] [-v <verbose-level>] 
                 ([-include <table-names>] | [-exclude <table-names>]) 
                 [-inheritance <orm-technology>:<ORM-file-url>] 
                 [-conf <configuration-file-location>]

I hope this post was helpful and interesting. Stay tuned.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}