Orientdb and teleporter issues

冷暖自知 提交于 2019-12-23 16:38:37

问题


I am having difficulty doing a simple use case with Orientdb and teleporter

Stack:

OS: Windows 10 / Java: v8 / Orientdb: 2.2 beta2 / Teleporter: 1.0.0 / Database: MS SQL Express 2014

Setup:

  1. Installed, MS SQL Express 2014 with instance name SQL2014
  2. Created new db Graphdb with two tables, Country w/ PK Country ID and Province w/ PK Province ID and FK Country ID
  3. Installed, and start Orient db 2.2 beta 2
  4. Created new oteleporter_graphdb.bat

    oteleporter.bat -jdriver sqlserver -jurl jdbc:sqlserver://:54963;instance:SQL2014;databaseName:graphdb -juser sa -jpasswd -ourl plocal:$ORIENTDB_HOME/databases/graphdb -s naive -nr java -v 2

Test Case:

  1. Run oteleporter_graph.bat as-is

This test case read the db and created warnings for table’s part of sql metadata but Country & Province were not part of it.

  1. Modify oteleporter_graph.bat to include both Country and Province table

    oteleporter.bat -jdriver sqlserver -jurl jdbc:sqlserver://:54963;instance:SQL2014;databaseName:graphdb -juser sa -jpasswd -ourl plocal:$ORIENTDB_HOME/databases/graphdb -s naive -nr java -v 2 –include Country,Province

This test aborted!

  1. Modify oteleporter_graph.bat to include only Country table.

    oteleporter.bat -jdriver sqlserver -jurl jdbc:sqlserver://:54963;instance:SQL2014;databaseName:graphdb -juser sa -jpasswd -ourl plocal:$ORIENTDB_HOME/databases/graphdb -s naive -nr java -v 2 –include Country

This test case ran without any error but didn’t read any table from the database nor output anything out.

Questions:

  1. Am I missing any configuration steps?
  2. Test case #2, how to define multiple tables? Other questions:
  3. Possible to add filter to the tables?
  4. Instead of tables, views can be included? how would teleporter will identify the PKs / FKs?

Thanks in advance


回答1:


I'll try to answer your questions in order.

  1. To install and run Teleporter you have to:
    • extract orientdb-teleporter-1.0.0.jar in your ORIENTDB_HOME/plugins path.
    • extract the oteleporter.bat and oteleporter.sh scripts in your ORIENTDB_HOME/bin path and launch them from that location with the expected arguments.
  2. You can define filters on multiple tables simply by using the syntax you used: -include <tableName1>,<tableName2>,...,<tableNameX> but if you are running Teleporter on Windows probably you need to add quotes to the last argument, so try with: –include "Country,Province"
  3. Filters are possible with a "table-granularity", so you can filter-in or filter-out entire tables but not elements contained in them (e.g. columns). In the next versions probably will be possible manage the schema filtering with a finer granularity.
  4. Teleporter includes only materialized views (persistent in your database) in the migration and in this first version identifies PKs and FKs starting from the metadata present in the schema of your database. Thus if you don't define a FK between two tables you won't have edges between the correspondent vertices. In the next version of Teleporter will be possible the relationships defining through an input JSON.

If you have any doubt you can refer to official page, documentation and blog posts here:

http://orientdb.com/orientdb-labs/teleporter/ (Official Teleporter Page)

https://github.com/orientechnologies/orientdb-labs/blob/master/Teleporter-Index.md (Official Documentaion)

http://orientdb.com/orientdb-teleporter-making-migrations-easier/ (Blog Post: OrientDB Teleporter - Making Migrations Easier (Part 1) )

http://orientdb.com/orientdb-teleporter-making-migrations-easier-part-2/ (Blog Post: OrientDB Teleporter - Making Migrations Easier (Part 2) )




回答2:


I'm trying your case with these steps:

  1. Copying orientdb-teleporter-1.0.0.jar into you /plugins folder;

  2. Copying oteleporter.bat into you /bin folder;

  3. Creating a new graphdb in MySQL with this structure:

    mysql> select * from province;
    +------------+--------------+-----------+
    | provinceId | provinceName | countryId |
    +------------+--------------+-----------+
    |          1 | Milano       |         1 |
    |          2 | Parigi       |         2 |
    +------------+--------------+-----------+
    
    mysql> select * from country;
    
    +-----------+-------------+
    | countryId | countryName |
    +-----------+-------------+
    |         1 | Italia      |
    |         2 | Francia     |
    +-----------+-------------+
    
  4. From the terminal, go to your /bin folder and run this command:

    oteleporter.bat -jdriver mysql -jurl jdbc:mysql://localhost:3306/graphdb
    -juser root -jpasswd MyPassword -ourl plocal:C:/path/to/graphdb -s naive -nr java -v 2
    
  5. Run the server.bat;

  6. Go to Orient Studio:

Now you can see the tables correctly created in OrientDB.

Hope it helps



来源:https://stackoverflow.com/questions/36941543/orientdb-and-teleporter-issues

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!