Ispirer Ispirer
 


Ispirer Home Page Ispirer SQLWays Migration Product Page Request SQLWays

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

You can use Ispirer Migration and Modernization Toolkit to migrate Microsoft SQL Server Database (Tables, Data, Views, Stored Procedures, Functions, Triggers, User Defined Types, Sequences, Indexes, Constraints, Synonyms.) to PostgreSQL. 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 - Tool which 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 - Tool which 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.

After the installation of Ispirer Migration and Modernization ToolKit you will see 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 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 toolkit using the license information you should have received. Here you can find a step by step guide that describes how to register Ispirer Migration and Modernization toolkit: How to Register 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 is successfully registered, we can proceed with the conversion of 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 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 then 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 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 here: Setting Up Microsoft SQL Database Connection

Please note: User that we specify on this 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 here: Source User Privileges

On the next page we need to select target database from the list of the supported databases. And then to 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

The 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 “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 the 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 perform import into the target database you need to have the 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:

PostgreSQL Native Utility

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

To run the conversion process, we need to click “Start Conversion” button on the “Conversion” tab of 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, thus the 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. It will open a folder that stores all the converted results together with the log files - sqlways.log and sqlways_imp.log files. Sqlways.log file 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 Microsoft SQL Server code stored in scripts or in files, you can use Migration Studio or Migration Commander tools.

Conversion Using Ispirer Migration Studio

First we need to specify the source and target. This can be done using the “Source” and “Target” options. For MS SQL Server to PostgreSQL direction we need to specify “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 pane we will 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 arranged side by side for your convenience.

Conversion Using Ispirer Migration Commander

Converting Files

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

In the opened window you need to provide the target directory, where our tool will put the converted files. After that please 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 the source code and generated target code.

Converting a Whole Folder

In Ispirer Migration Commander tool you can also specify a whole folder for conversion, so that the tool will convert all the files in the folder and its subfolders. In order to do that 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. Then 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 the source code and generated target code.



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 Ispirer Migration and Modernization toolkit and get the demo license from our official web site just filling out the form on this page:Download Migration Tool With License.


If you have any questions or face any issues, 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: March 29, 2019, 11:08:33 AM by darya.prikhodkina
 
© 1999-2019, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement