Converting from a SQL Server to another SQL Server using the Flex2SQL tool

The primary function of the Flex2SQL Utility (for either Classic Edition Driver or Unicode Drivers) is to take your existing DataFlex DAT tables and indexes and convert them to your target SQL backend. However, this utility can also be used to Transfer your existing SQL Tables:

  • Between 2 physical servers of the same type, for example from one MS SQL server to another.

  • Between 2 servers of different types, for example from a PostgreSQL Server to an MS SQL server.

In addition, it can also be used to rewrite your INT files from using DAW SQL drivers to Mertech drivers.

Transfer your existing SQL Tables

In this section the steps needed to transfer your tables are provided. After that, a sample transfer.

The steps needed to transfer your tables:

  1. To begin the process, copy the .INT files from the data directory in your workspace into a separate folder. The location of this folder will be needed in step 5.

  2. Run the Flex2SQL Utility (see Quick Start Guide, unicode or Quick Start Guide, classic edition for more details on how to start the utility) and log into the target server.

  3. Select the Dataflex workspace which has the tables to convert if it is not already selected. Select Main Menu | File | Open and load the source tables (Unicode: Workspace Manager Classic: Workspace Manager).

  4. Check the Main Menu | Tools | Preferences to make sure all the migration preferences are correct (Unicode: Preferences, Classic: Preferences).

  5. Set the Migrate Non-DataFlex Files checkbox in the Filelist dialog (Unicode: Filelist dialog, Classic: Filelist dialog) and either enter or browse to the directory containing the source INT files (see step 1).

  6. Select the files to migrate in the Filelist Dialog and Press the Convert Database button (Unicode: Convert Dat to Table, Classic: Convert Dat to Table).

  7. Select Create Tables & Indexes and Migrate Data from the radio group and then press the Convert all.

  8. When the process is complete, check the Migration report, Main Menu | Reports | Migration Report, for details on the migration success.

At this point you may wish to update the login code, if you have any, to reflect the new server.

A sample tranfer

In this example, the Unicode Flex2SQL Utility will be used, however, the steps are the same for Classic Edition.

Initial configuration

  • The tables in the Order Entry Example from DAW reside on a MySQL server.

  • The tables need to be moved to an MSSQL Server.

  • The workspace, Order Entry My SQL Example, resides in C:DataFlex Testing UtilityUnicodeEditionOrder Entry MySQL

The transfer

  1. Copy the .INT files into another directory: A new directory C:DataFlex Testing UtilityUnicodeEditionOrder Entry MySQLDataMYSQLINT is created and the .INT files in A new directory C:DataFlex Testing UtilityUnicodeEditionOrder Entry MySQLData are copied into this new directory.

  2. Run the Flex2SQL Utility and log into the target server: The target server is WIN11DEVMDSEXPRESS using a trusted connection:

ConvertNon_Login.png

selecting the Flex2SQL Database:

ConvertNon_Database.png
  1. Select the Dataflex workspace: File | Open | Select Workspace, selecting Order Entry MySQL Example.

ConvertNon_SelectWorkspace.png

will display the filelist:

ConvertNon_Filelist.png
  1. Check the Preferences: Navigate to Main Menu | Tools | Preferences:

ConvertNon_Preferences.png

Once all the preferences are set, press OK. It may also be a good idea to clear the Migration Report (Main Menu | Reports | Clear Migration Report). This way only the conversion will be reported.

5. Set the location of the MySQL INT files: Check the Migrate Non-DataFlex Files and either press the Browse button and navigate to their location or enter it into the .INT File Directory form:

ConvertNon_INTFileDir.png
  1. Select the files to migrate. In this case, I am migrating all of the MySQL tables (a quick way to do this is press the Select All button):

ConvertNon_SelectFiles.png

Press the Convert Database button. It will show the login for the MySQL (source database) server:

ConvertNon_MySQLLogin.png

Once logged in, the Convert DAT to Table dialog will show:

ConvertNon_ConvertDat.png

At this point, changes can be made as to how the data will be migrated. For Classic Edition, see Convert Dat to Table. For Unicode Edition see Convert Dat to Table.

  1. Convert the Data: Select Create Tables & Indexes and Migrate Data from the radio group and then press the Convert all. This will close the Convert the Data and a new dialog will popup showing the progress of the conversion. For small tables like this it will go very fast.

  2. Check the Migration Log: When the process is complete, check the Migration report, Main Menu | Reports | Migration Report, for details on the migration success.

ConvertNon_MigrationReport.png

The migration is now complete and the program code, if any is used, can be updated.