Ispirer Ispirer
 


Ispirer Home Page Ispirer SQLWays Migration Product Page Request SQLWays

How To Migrate Microsoft SQL Server to PostgreSQL Using Ispirer MnMTK ToolKit

To migrate Microsoft SQL Server Database (Tables, Data, Views, Stored Procedures, Functions, Triggers, User Defined Types, Sequences, Indexes, Constraints, Synonyms.) to PostgreSQL can be used Ispirer Migration and Modernization Toolkit. This toolkit includes 3 tools:

  • SQLWays Wizard - Tool that is able to migrate the objects directly from one database to another (Tables, Data, Views, Stored Procedures, Functions, Triggers, User Defined Types, Sequences, etc.). To connect to the source database it uses ODBC connection and to load the converted objects it uses native utilities.
  • Ispirer Migration Studio - Is able to convert only one script at a time. In this script you can provide sql statements and definitions of the following objects:Tables, Views, Stored Procedures, Functions, Triggers, User Defined Types, Sequences, etc.
  • Ispirer Migration Commander - Is able to convert multiple scripts or all the scripts in the provided folder including all the sub-directories. In these scripts you can provide sql statements and definitions of the following objects:Tables, Views, Stored Procedures, Functions, Triggers, User Defined Types, Sequences, etc.

So after the installation of Ispirer Migration and Modernization ToolKit you will 3 tools on your desktop:



- Ispirer SQLWays Wizard Tool.





- Ispirer Migration Studio Tool. Tool that allows to convert only one application script at a time.





- Ispirer Migration Commander Tool. Tool that allows to convert multiple scripts at a time.





Ispirer Notification:

You can get the Ispirer Migration and Modernization Toolkit for Free by filling out the form on our official web site: Get the Tool For Free Now

1. Registration

If you run one of the tools for the first time, you need to register the tool using the license information that you have. Here you can find a step by step guide that describes how to register the Ispirer Migration and Modernization toolkit: How to Register the Ispirer Migration and Modernization Toolkit

Ispirer Notification:

If you don't have a license, you can get it by filling out the form on our official web site: Get Free License for Ispirer Migration Toolkit

2. Conversion

After the registration process is done, and toolkit registered successfully, we can proceed with the conversion of the Microsoft SQL Server Database into PostgreSQL.

2.1 Conversion Using SQLWays Wizard

To convert the database directly from the source database we can use SQLWays Wizard tool.

On the first page of the SQLWays Wizard we need to provide the project directory. In this directory our tool will generate project file that will store information about the current migration process.

Then we need to choose the ODBC connection to the source database that should be migrated. And specify a user and a password that will be used to connect to the source database.

Please note: Our tool works using the ODBC connection to the source database only! It means that before using the SQLWays Wizard tool you need to install the ODBC driver and tune the ODBC connection to the database that should be migrated. Some additional information about the ODBC driver installation and configuration can be found on that page: Setting Up Microsoft SQL Database Connection

Please note: User that we specify on that page should have appropriate rights to make selects from system tables from your source database. More information about source database user privileges can be found on that page: Source User Privileges

On the next page we need to select target database from the list of the supported databases. And specify correct information about the target database, for example, server name, database name, user name and a password.

This information will be used by our tool to generate correct command lines to psql.exe native utility of the target database. More information about the utilities used for making import is stored here: PostgreSQL Native Utility

Next step is to specify objects for conversion from the list of objects that our tool was able to extract from MSSQL database. To select objects you can just drag-n-drop the required objects to the right pane of the tool. Or you can select objects using buttons at the bottom of the tool:

If during the migration process the list of objects was updated, for example some additional objects were created or dropped from the database, you can refresh the list of extracted objects. To do that just right click on the required object type or on the “Database” branch and click “Refresh” button, like it is shown on the screenshot:

If required, you can specify different options that can be used to customize the conversion process. These options can be found on the “Specify DDL and Data Options” page:

After that, you will need to specify Export Directory. This is the directory where our tool will put all the generated files, like sql files with the converted PostgreSQL code, txt files with the data extracted from MSSQL database, bat or sh files with the commands to the native utilities.

Then we need to specify the Bin Directory. This is the path where native utility of the target database is stored on your local machine where Ispirer Migration and Modernization Toolkit is installed. It means that to be able to make an import into the target database you need to have native utility installed on the machine where you run the conversion.

For more information about the PostgreSQL native utility, that will be used by our tool, please refer to that link:

PostgreSQL Native Utility

After all these steps we need to run the migration. Migration process itself consist of two steps: “Conversion” and “Import”. During the conversion step our tool extracts information about the objects specified for a conversion, converts them and generates appropriate set of files. During the import step our tool tries to create all the converted objects and data into the target database.

To run the conversion process, we need to click “Start Conversion” button on the “Conversion” tab on the “Migration Status” page:

After the conversion process is finished, we need to run the import process. So we need to go to the “Import” tab and click “Start Import” button and import process will be initiated.

After the migration process you can review all the generated files in the export directory by clicking “View Export” button on the “Conversion” tab. And this button will open a folder that store all the converted results together with the log files - sqlways.log and sqlways_imp.log files. Sqlways.log files stores detailed information about the conversion step and sqlways_imp.log file stores information about the import process.

2.2 Scripts Conversion Using Ispirer Migration Studio and Ispirer Migration Commander

If you need to convert the Microsoft SQL Server code stored in scripts or in files, you can use Migration Studio or Migration Commander tool.

Conversion Using Ispirer Migration Studio

First of all in Ispirer Migration Studio we need to provide the source and target destinations. This can be done using the “Source” and “Target” options. So for MS SQL Server to PostgreSQL direction we need to provide “MS SQL Server” as a source and “PostgreSQL” as a target. After that we need to provide SQL Server code in the left pane of the tool and click “Run Conversion” button. After the conversion process is finished, in the right window we can see the results of conversion - generated PostgreSQL. Please see the screenshot for your reference:

After the conversion you can review the source and converted target code, side by side for your convenience.

Conversion Using Ispirer Migration Commander

Converting Files

In Ispirer Migration Commander we need to provide the source and target destinations. This can be done using the “Source” and “Target” options. After that we need to specify the files that should be converted and click “Run conversion” button.

In the opened window you need to provide the target directory, where our tool will put the converted files and click “Ok”:

After the conversion process is finished, the converted files will be located in the target directory. And by clicking the files in the left and right panels, you can compare source code and generated target.

Converting Whole Folder

Also in the Ispirer Migration Commander tool you can specify a whole folder for a conversion. And the tool will convert all the files in the folder and its subfolders. In that case you just need to choose the selected folder and click “Run Conversion” button:

Then you have to provide the target directory, where converted files will be placed. Also when migrating from MS SQL Server to PostgreSQL we can provide a “File Mask” to convert only the files with the required extension. If we need to convert all the files, we need to leave the file mask as is. And click “Ok”. Please see the screenshot:

After the conversion process is finished, the converted files will be located in the target directory. And by clicking the files in the left and right panels, you can compare source code and generated target.



Also you can review the recorded demo on our youtube channel that shows how to migrate Microsoft SQL Server Database to PostgreSQL code: Microsoft SQL Server to PostgreSQL Conversion Demo


You can download the Ispirer Migration and Modernization tool and get the demo license from our official web site, just fill out the form in this page:Download Migration Tool With License.


If you will have questions or face with some difficulties please feel free to mail us: support@ispirer.com


Ispirer Home Page Ispirer SQLWays Migration Product Page Request SQLWays

sqlways/users-guide/migrate-mssql-to-postgres.txt · Last modified: November 14, 2018, 09:26:26 AM by alexandr.kirpichny
 
© 1999-2019, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement