Knowledge base · Studio 3T Desktop IDE

Using Hackolade to configure Studio 3T SQL Migrations

By Dj Walker-Morgan · Updated

Studio 3T has an extensive range of operations it can perform to merge data in a relational schema (and usually SQL) into a document centric schema. For some users, they wish to approach this task using modeling tools such as Hackolade which can assist with the field mappings and leave a documentable pathway and records for future use. For those users, we have the Hackolade integration.

Required Versions:

  • Hackolade: At least version 5.0.5 of Hackolade is required to create Studio 3T importable models; we recommend that users install Hackolade 5.1.2 or later, for full functionality.
  • Studio 3T: The Hackolade integration is available in Studio 3T version 2021.6.0 and later.

Watch the video on Vimeo

Starting A Migration

A migration, using Hackolade, begins at the source SQL database; you should export the schema DDL you wish to migrate there as a DDL formatted backup. That file typically requires a `.sql` extension. Once you have this file, move to Hackolade.

In Hackolade, create a new model using Hackolade➡New Model.

New Model Selection for Hackolade

Select the target database for the new model.

Important: Studio 3T needs the lineage data that Hackolade models optionally generate. On creating the new model, select the node at the top of the object browser tree and then, on the opposite side of the screen, under Properties and the Details tab, check the Lineage checkbox.

As Lineage Is Important. Always select the lineage checkbox

The Lineage Checkbox must be selected.

Select Tools➡Reverse Engineer➡Data Definition Language file… to begin the process of creating the model. If you have not turned on Lineage at this point, Hackolade will warn you with this dialog and an opportunity to turn Lineage on:

Lineage Warning Dialog. A reminder that lineage is important.

This dialog reminds you to turn on Lineage so Hackolade and Studio 3T can work together.

Hackolade will then import the DDL file and convert it to a Hackolade model.

A Hackolade Model in Hackolade

A Hackolade model in Hackolade, ready for refining

You can now continue your work with Hackolade, reorganizing and denormalizing the model. Hackolade is able to suggest denormalizations using Tools➡Suggest Denormalization. This will show which tables that can be denormalized or linked with a two way reference.

Hackolade can suggest denormalizations in this dialog

Hackolade can suggest denormalizations to your model to simplify and streamline it

Using suggested denormalization is an effective way of reducing the relational tables down to manageable documents. Hackolade provides more extensive guidance on this process and in depth examples in their SQL DDL documentation. Once your remodeling is complete, save the Hackolade model.

Running A Migration

Switch to Studio 3T and select the SQL Migration➡SQL→MongoDB Migration option from the global toolbar at the top of the screen. You may be presented with a tutorial, click on the Overview tab to dismiss it. You are now at the Migration overview tab where you can configure one or more migrations.

Starting SQL Migration, the Studio 3T view

This is a new SQL migration without any connections configured

To start configuring, click on the link next to Source SQL connection: which will allow you to create a new SQL database connection or reuse an existing configuration. Connect to your source database here.

Next, select the target MongoDB database connection using the link next to the Target MongoDB connection, choosing the MongoDB database that will be the destination for the migration.

Importing A Hackolade Model

The Add Hackolade Button

The Add Hackolade Button will import a Hackolade model and use it for an SQL migration

Now, click on the + Add from Hackolade button in the toolbar immediately above the migrations list and select your Hackolade model file. It will then be imported and interpreted as a set of Studio 3T SQL import sources. Once complete, the overview will display each migration source in a list. Each row of the list shows source table, target database and collection, along with the insertion mode for handling id collisions.

A Hackolade model shown previously imported into Studio 3T as sources

A Hackolade model imported into Studio 3T at the highest level (import sources)

As these are now import units, you can open the mappings editor either by double clicking a unit in the list, or by selecting a unit and clicking the Mappings button.

Hackolade model translated to Studio 3T mappings

The Hackolade model, translated into Studio 3T mappings for the SQL migration

The Mappings editor shows the exact field mappings and lets the user preview the JSON which will be generated with live data. If you wish, you can also make final modifications to the migration mappings. Any changes made here are not, currently, recorded in Hackolade.

Running A Migration In Studio 3T

When you are happy with the migration, you can click Run Migration and the migration will be performed.

Run Migration Button to start the actual migration

Clicking the Run Migration button will start all the import sources configured

The Migration’s progress appears in the Operations pane. It is also possible to save this migration as a Task, with Save Task and to use the Studio 3T Task Scheduler to run it at specific dates and times in the future.

With your consent, we and third-party providers use cookies and similar technologies on our website to analyse your use of our site for market research or advertising purposes, including personalized advertising (“performance”), to provide you with additional functions (“functional”), and to show content from social media platforms, such as embedded videos (“social media”). This may result in the creation of pseudonymous usage profiles and the transfer of personal data to third countries, including the USA, which may have no adequate level of protection for the processing of personal data. Please choose for which purposes you wish to give us your consent and store your preferences by clicking on “Accept selected”. You can find further information in section 9 of our Privacy Policy.

Manage consent preferences