Skip to the main content.
Downloads Thriftly Login
Downloads Thriftly Login
Group 762

Migrate and run DataFlex applications with Oracle, MS SQL Server, PostgreSQL, MySQL &  MariaDB.

flex2Crystal

Stuck in Crystal XI?  Upgrade and use the latest versions of Crystal Reports with DataFlex applications. 

BTR2SQL

Seamlessly convert from Btrieve transactional database to PostgreSQL, Oracle, and MS SQL Server.

thriftly-1

Quickly build multi-protocol web services with the same API. Supports JSON-RPC, REST, SOAP,  Thrift, and gRPC.

 Group 671-1

 

Why Mertech?

4 min read

Testing Btrieve and SQL side by side

Testing Btrieve and SQL side by side

The Task

In the initial phases of your evaluation of the Mertech SQL solution for migrating Btrieve to SQL, you probably want to compare and contrast your application running against Btrieve and against SQL. Perhaps you want to compare dialogs or reports to ensure the data is all looking the same; or you may want to compare speed.


An Answer

I’ll describe here a technique that will allow you to run your application against the original Btrieve data and against MSSQL and Oracle all at the same time so you can easily compare the screens, reports, etc.


Consider the Pervasive Function Executor as your application and the demodata as the application’s data. You might have an installation directory looking like this:

Directory of C:\MyApp

11/10/2009  03:08 PM    <DIR>          .
11/10/2009  03:08 PM    <DIR>          ..
06/09/2005  08:59 PM            42,496 w3btrv7.dll
06/10/2005  12:00 AM           162,816 wdbuui32.dll
06/09/2005  10:59 PM           950,784 WBEXEC32.exe
05/31/2009  09:33 PM           151,552 FIELD.DDF
05/31/2009  09:33 PM            81,920 FILE.DDF
05/31/2009  09:33 PM            90,112 INDEX.DDF
05/31/2009  09:33 PM           401,408 BILLING.MKD
05/31/2009  09:33 PM           135,168 CLASS.MKD
05/31/2009  09:33 PM            94,208 COURSE.MKD
05/31/2009  09:33 PM            90,112 DEPT.MKD
05/31/2009  09:33 PM         1,052,672 ENROLLS.MKD
05/31/2009  09:33 PM            98,304 FACULTY.MKD
05/31/2009  09:33 PM         1,077,248 PERSON.MKD
05/31/2009  09:33 PM           106,496 ROOM.MKD
05/31/2009  09:33 PM           290,816 STUDENT.MKD
05/31/2009  09:33 PM            81,920 TUITION.MKD
              16 File(s)      4,908,032 bytes

We see your application (wbexec32.exe), the Btrieve access dll (w3btrv7.dll), the data definitions (*.ddf) and the data files (*.mkd).
Once you migrate the data to the SQL backend of choice, each data file will have a corresponding .INT file. The original Btrieve data and ddf files are not needed for deployment on SQL.

 

Adding Microsoft SQL to the Picture

To make a side-by-side test that uses SQL access, you can run a script like this (or do it manually in Windows Explorer) from the C:\MyApp command prompt:

mkdir ..\MyApp_mssql
copy *.dll ..\MyApp_mssql
copy *.exe ..\MyApp_mssql
move *.int ..\MyApp_mssql

Now, replace the w3btrv7.dll in c:\MyApp_mssql with the version from
Mertech Data Systems\DB Drivers\Btrieve\deploy\mssql. You have a directory like this:
Directory of C:\MyApp_mssql


11/11/2009  07:51 AM    <DIR>          .
11/11/2009  07:51 AM    <DIR>          ..
10/07/2008  04:42 PM             1,332 sql_btr.cfg
10/29/2009  12:50 PM           771,584 w3btrv7.dll
06/10/2005  12:00 AM           162,816 wdbuui32.dll
06/09/2005  10:59 PM           950,784 WBEXEC32.exe
10/23/2009  04:00 PM             2,404 BILLING_MKD.INT
10/23/2009  04:00 PM             2,644 CLASS_MKD.INT
10/23/2009  04:00 PM             1,407 COURSE_MKD.INT
10/23/2009  04:00 PM             1,579 DEPT_MKD.INT
10/23/2009  04:00 PM             1,285 ENROLLS_MKD.INT
10/23/2009  04:00 PM             2,426 FACULTY_MKD.INT
10/23/2009  04:20 PM             7,306 PERSON_MKD.INT
10/23/2009  04:00 PM             1,815 ROOM_MKD.INT
10/23/2009  04:00 PM             2,460 STUDENT_MKD.INT
10/23/2009  04:00 PM             1,576 TUITION_MKD.INT
              14 File(s)      1,911,418 bytes

 

Adding Oracle to the Picture

Do this same process for Oracle — migrate the application data to Oracle using BTR2SQL. This again generates the INT files (which are specific to the backend targeted). Create a third copy of the application folder:

mkdir ..\MyApp_oracle
copy *.dll ..\MyApp_oracle
copy *.exe ..\MyApp_oracle
move *.int ..\MyApp_oracle

Now, replace the w3btrv7.dll in c:\MyApp_oracle with the version from
Mertech Data Systems\DB Drivers\Btrieve\deploy\oracle. You have a directory listing like this:
 Directory of C:\MyApp_oracle


11/11/2009  07:50 AM    <DIR>          .
11/11/2009  07:50 AM    <DIR>          ..
10/21/2005  02:17 PM             1,332 ora_btr.cfg
10/29/2009  01:01 PM           694,784 w3btrv7.dll
06/10/2005  12:00 AM           162,816 wdbuui32.dll
06/09/2005  10:59 PM           950,784 WBEXEC32.exe
11/10/2009  03:15 PM             2,474 BILLING_MKD.INT
11/10/2009  03:15 PM             2,729 CLASS_MKD.INT
11/10/2009  03:15 PM             1,461 COURSE_MKD.INT
11/10/2009  03:15 PM             1,637 DEPT_MKD.INT
11/10/2009  03:15 PM             1,286 ENROLLS_MKD.INT
11/10/2009  03:15 PM             2,522 FACULTY_MKD.INT
11/10/2009  03:15 PM             7,559 PERSON_MKD.INT
11/10/2009  03:15 PM             1,940 ROOM_MKD.INT
11/10/2009  03:15 PM             2,461 STUDENT_MKD.INT
11/10/2009  03:15 PM             1,603 TUITION_MKD.INT
              14 File(s)      1,835,388 bytes

 

Running All Three at the Same Time

Create a shortcut to each edition of the application. Now you can run each of them separately or at the same time. Since the access dll is in the directory with the application, it will use this method of data access (Btrieve, MSSQL, or Oracle).


Accessing the Files with B_OPEN

Remember, your application is to run unchanged – no changes to the code, directory structures, etc. So, it will request to open data files with the same filename as before, even though they don’t exist. Normally you don’t have to worry with this because the application will just do this. But since we are using Function Executor here as an example and it allows you to open any Btrieve file, it might be confusing.


Consider billing.mkd – before, you would run wbexec32.exe with c:\MyApp as the current directory (the Start In folder). Using the Open dialog, you would request to open “billing.mkd”.


Even though billing.mkd does not exist in the MyApp_mssql folder, when you run wbexec from this location, you still request to open “billing.mkd”; Function Executor will complain that the file doesn’t exist. Click Ignore and the Mertech driver will read billing_mkd.int and know how to handle the request.


Conclusion

With the technique described here, you should be able to run your application against multiple server backends simultaneously, allowing you to compare screen dialogs, reports, and overall application responsiveness.

The example here is using a very simple application and dataset, your application may require extra steps (component registrations perhaps) in order to work in a different directory location.

 

Why Migrate from Btrieve to PostgreSQL and other Relational Databases?

Why Migrate from Btrieve to PostgreSQL and other Relational Databases?

Introduction Many independent software vendors (ISV) and corporate users still rely on applications that use a category of database collective called...

Read More
Four Challenges in Converting COBOL Applications from ISAM Databases to Relational Databases

Four Challenges in Converting COBOL Applications from ISAM Databases to Relational Databases

COBOL applications are the foundation of numerous essential business functions, especially within the banking, insurance, and government sectors....

Read More
Application Modernization 101: Ultimate Guide to Digital Transformation

Application Modernization 101: Ultimate Guide to Digital Transformation

Imagine breaking free from the constraints of old, monolithic systems and embracing the agility and innovation of cloud-based solutions.

Read More