You can create a project using a pre-defined sample schema. The sample schema allows you to try Relational Migrator even if you don't have a relational database to connect to.
About this Task
Creating a project with a sample schema is the quickest and easiest way to test drive Relational Migrator.
Before finalizing the creation of your project, you have the choice to select the initial mappings. These options include starting with a recommended MongoDB schema, which is automatically suggested by Relational Migrator based on your relational database.
Steps
These steps create a project from the sample schema. You don't need a relational database connection to complete them.
In Relational Migrator, click New Project at the top-right of the Relational Migrator home screen.
Click the Create sample button.
From the Select tables screen, indicate the tables you want to migrate and click Next.
The tabs below explain the different ways you can select tables to migrate:
Expand the tree to view databases, schemas, and tables.
Use the check marks to select items:
All tables within a database: Click the check mark for the database.
All tables within a schema: Expand the database and click the check mark for the schema.
Specific tables within a schema: Expand the database and schema, then select tables individually.
Specific table names: Use the Filter bar above the Relational Schema list.
Switch to Bulk Selection.
Paste or type a comma-separated list of fully qualified table names (for example,
database.schema.table).As you type, Relational Migrator filters the list and lets you click matching tables to include or exclude them.
Choose a Global casing option for collection names.
This option affects the names of your collections created from the tables in your relational database:
Keep Original: Keep the original casing used in your relational database table name.
Override with Global Casing: Override the original table name with a global casing convention.
camelCaseTitleCasekebab-casesnake_caseUPPER_SNAKE_CASE
Choose an Initial mappings option for your MongoDB schema.
- Start with a MongoDB schema that matches your relational schema
- Creates your initial project with a new document mapping rule for each table. This option displays a table of imported relational tables, which are grouped by database and schema, and listed in alphabetical order. Each collection is represented as a top-level collection. You can view the corresponding collection name in each table. For collection names, Relational Migrator applies global casing to the original table name.
- Start with a recommended MongoDB schema
- Relational Migrator creates mapping rules for a suggested MongoDB schema. When you choose this option, a table appears showing the imported relational tables. Relational Migrator suggests which tables should be represented as top-level or embedded collections. You can use the checkboxes to modify which tables are mapped into collections or embedded.
- Start with an empty MongoDB schema
- Creates your initial project with no mapping rules.
Note
Regardless of the option you choose when starting your project, you have the flexibility to manually add, remove, or modify mapping rules at any time. This allows you to customize the MongoDB schema according to the specific requirements of your workload.
Enter a name for your project.
Click Done.
Add Sample Data (Optional)
Migration jobs and other features require a live connection to a relational database. MongoDB provides a sample relational database so that you can test those features with the project that you created. The sample database is a PostgreSQL instance of Northwind, packaged as a Docker container.
To start the container, run the following command:
docker run -p 5432:5432 public.ecr.aws/v4d7k6c9/relational-migrator-sample-database
The database listens on port 5432. The username and password are both postgres. Use these credentials to add the container to your project as a connection. To learn more, see Connect to PostgreSQL.