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:
- BigQuery JDBC 4.2
- Snowflake JDBC 3.13.19
- Postgresql JDBC 42.3.7
- MySQL JDBC 8.0.30
- Kinetica JDBC 7.1.7.7
- Google Cloud Spanner JDBC 2.6.2
- SQL Server JDBC 12.2.0
- DB2 JDBC jcc4
- Oracle JDBC 23.2.0.0
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
- 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
- Unzip the downloaded file
- Run rosetta commands using
./rosetta
which is located insidebin
directory. - 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.