This is an old revision of the document!


How to Convert and Import Database in Command Line Mode

Ispirer Migration and Modernization Toolkit allows you to convert and load converted database via command line or shell script.

First of all we need to open a command line window by running Start → SQLWays 8.x → SQLWays Command Line or Start → Run → cmd.exe

Prepare Command Line

To convert database objects we need to use sqlways.exe command line utility. So we have to prepare appropriate command line for this command line tool.

Command line may look as follows:

"c:\Program Files (x86)\Ispirer\MnMTK2017\sqlways.exe" /D="MSSQL_VMDBSRVDEMO001_itest" /U=sa /P=pwd /DIR="S:\Tests\tab" 
/LOG=sqlways.log /TARGET="POSTGRE" /GCMD=sqlways_all.bat /PRJF=C:\Users\Alexandr.Kirpichny\Documents\Ispirer\SQLWays 8.0\sqlways.xml 
/INI=C:\Users\Alexandr.Kirpichny\Documents\Ispirer\SQLWays 8.0\sqlways_db.ini /TD="postgres" /TH="vmdbsrvdemo004" /TP=pwd /TU=postgres 

Note: SQLWays command line options are case insensitive and their order is insignificant.

Here is the list of parameters used in the provided command line:

  • sqlways.exe - this is the name of the utility that performs the conversion. If required it can be specified with the full path to the utility.
  • /d - specifies the ODBC Data Source Name (DSN) to connect to the source database. Articles on how to tune the ODBC Connection to your source database can be found here: How to Tune ODBC Connection.
  • /U - specifies the user name for the source connection.
  • /P - specifies the password for the source connection.
  • /DIR - specifies the location of the generated files (output directory).
  • /LOG - specifies the name of the conversion log file.
  • /TARGET - specifies the target database.
  • /GCMD - specifies the name of the general command file name. General Command File is a file that initiates the import.
  • /PRJF - specifies the path to the project file. In this file information about the objects specified for conversion is stored. Here you can find the information about the project file: Project file description.
  • /INI - specifies the options file. Options file is a file that stores all the options supported by the tool. Options file with the default settings is located in the directory like: “C:\Users\[user_name]\Documents\Ispirer\SQLWays 8.0\”. You can use it as a default options file. More information about the supported options can be found here: Options file description.
  • /TD - specifies the target database name, where import should be done.
  • /TH - specifies the target host\server name.
  • /TP - specifies the password that will be used to connect to the target database.
  • /TU - specifies the user name for the target connection.


The Easiest Way To Get The Command Line

The easiest way to prepare correct command line is to run SQLWays Wizard tool, select all the required objects for conversion and on the “Review the Selections” page, you will see the generated command line:

You can just copy the generated command line and run it.

Run the Prepared Command Line

After we prepared the command line with appropriate set of options we need to run it in the command line prompt.

And as a result, in the output directory we will see all the generated scripts.

Thus the conversion process is finished.

During the “Conversion” process SQLWays.exe tool generates all the scripts required for the import and places them in the appropriate order so that to save the referential integrity.

So, to make import we just need to run the generated “sqlways_all.bat” file. To do that, we need to go to the output directory (directory that we have specified in the /DIR option) and run this file.

Please see the screenshot for your reference:

Also you can run the general command file name as follows:

In this case all the information about the import process (all the warnings, notifications and error messages) will be stored in the “sqlways_imp.log” file.


A more detailed list of command line options can be found here: Command Line Options
If you have any questions on how to run the migration in batch mode, please contact our technical team: support@ispirer.com



More about Ispirer Systems