DEV Community

InterSystems Developer for InterSystems

Posted on

DB Migration using SQLgateway

Thanks to Yuri Gomes we have seen a very nice example for DB migration from Postgres to IRIS.

My personal problem is the use of DBeaver as a migration tool.
Especially as one of the strengths of IRIS ( and also Caché) before is the availability of the
SQLgateways that allow access to any external Db as long as for them an access usinig 
JDBC or ODBC is available. So I extended the package to demonstrate this.

It is a classic OEX package with a complete Docker.

The SQLgateway is installed during Docker build and the required jdbcdriver for Linux

is included in this repo In order to make this demo faster, the size of tables to migrate

have been shrunk a bit. 

How to test

All migration actions can be executed directly from SMP.

1.   

Verify the gateway connection in     

SMP> Administration> Configuration >Connectivity >SqlGateway_Configuration     
Image description

To test Connection click edit

Image description  

and Test Connection     

Image description  

  • verify Connection successful     
  • Be patient at this point. Postgres Containers sometimes take quite some time to talk to you.     - Wait a little bit, reload the page in browser and try the test again.     
  1. Identifying the source tables. In SMP > Change to Namespace USER then step to      SMP >Explorers >SQL >Wizards > Data Migration    ![] Image description  

3.     

Set required import parameters         

Image description

  • Destination Namespace        - Type = TABLE       - Gateway = postgres      >>>  now the first connection is established and you select              - Schema = public                - Tables to migrate = all         

4.      

Identify target but change schema to be OEX compatible from public to dc_public     
Image description  

  don't forget to click change all     

-  we migrate Definitions and Data so both sides are selected       

5.        

Skipping special settings we use defaults we start the task in background           

Image description     

6.     

Now we check the results and see everything was working without Errors     
Image description     

  • You might see errors if tables depend on the content not yet migrated.        - And wait for completions until the status shows Done     

7.     

We terminate the Migration Wizzard and return to normal table view filtered by dc*     
Image description      

- All 8 tables are visible and show meaningful columns
 

8.             

Selecting a table and clicking on OpenTable shows reasonable contents     
Image description      
                         

Image description         

9.    

A look into the related generated Class Definitions confirms the result and successful completion.     
Image description    

Top comments (0)