Skip to content

Getting Started

Getting Started

Prerequisites

You need the JDBC drivers to connect to the sources/targets that you will use with the rosetta tool. The JDBC drivers for the rosetta supported databases can be downloaded from the following URLs:

ROSETTA_DRIVERS Environment

Set the ENV variable ROSETTA_DRIVERS to point to the location of your JDBC drivers.

export ROSETTA_DRIVERS=<path_to_jdbc_drivers>

example:

export ROSETTA_DRIVERS=/Users/adaptivescale/drivers/*

rosetta binary

  1. Download the rosetta binary for the supported OS (releases page). rosetta-<version>-linux-x64.zip rosetta-<version>-mac_aarch64.zip rosetta-<version>-mac_x64.zip rosetta-<version>-win_x64.zip
  2. Unzip the downloaded file
  3. Run rosetta commands using ./rosetta which is located inside bin directory.
  4. Create new project using rosetta init command:
rosetta init database-migration

The rosetta init command will create a new rosetta project within database-migration directory containing the main.conf (for configuring the connections to data sources)

5.Configure connections in main.conf

example: connections for postgres and mysql

connections:
  - name: mysql
    databaseName: sakila
    schemaName:
    dbType: mysql
    url: jdbc:mysql://root:sakila@localhost:3306/sakila
    userName: root
    password: sakila
  - name: pg
    databaseName: postgres
    schemaName: public
    dbType: postgres
    url: jdbc:postgresql://localhost:5432/postgres?user=postgres&password=sakila
    userName: postgres
    password: sakila

6.Extract the schema from postgres and translate it to mysql:

   rosetta extract -s pg -t mysql

The extract command will create two directories pg and mysql. pg directory will have the extracted schema from Postgres DB. The mysql directory will contain the translated YAML which is ready to be used in MySQL DB.

7.Migrate the translated schema to MySQL DB:

   rosetta apply -s mysql

The apply command will migrate the translated Postgres schema to MySQL.