Skip to the main content.
Downloads Try Thriftly
Downloads Try Thriftly
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

Convert from Btrieve / P.SQL / Actian transactional engines to Oracle, MS SQL Server, and PostgreSQL

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?

2 min read

Migrating multi-directory Btrieve and P.SQLdata files to SQL backends with BTR2SQL

Migrating multi-directory Btrieve and P.SQLdata files to SQL backends with BTR2SQL

“What’s the best way to migrate a multi-directory Btrieve database to a SQL backend?” It’s a question that comes up often, considering that in SQL, different tables with the same names will collide if stored in the same database.


The scenario pops up because applications using a multi-directory structure store general information in a top directory, and region-specific information in lower directories. Here’s an example of this structure:

multi-directory structure example: folders before migration


Btrieve to SQL migration options

To get around this potential for collisions, Mertech’s BTR2SQL GUI offers several ways to resolve this problem:

Migrate each folder to a separate server or database

If you choose this option, you’ll be migrating each of your company-specific directories to a separate server or database, so similarly-named tables don’t conflict with each other.


Pros:

    • This option allows you to easily load balance your application by distributing data across multiple computers, CPUs, hard disks, etc.
    • If you select this option, you can assign user credentials based on each server or database.


Cons:

    • Your transactions won’t cross multiple “customers,” since the driver will have a unique connection to the database for each data folder.
    • This option adds the administrative overhead of backing up and maintaining additional hardware and software.

 

Migrate each folder to a separate schema (users on Oracle)

If you choose this option, you’ll be migrating each of your company-specific directories to separate schemas (users in Oracle), in much the same way you’d be migrating to multiple databases or servers if you chose the option above. However, migrating to separate schemas on Oracle allows you to more granularly control user access.

Pros:

    • There is a clean distinction between “sets” of data.
    • You can assign different user credentials to each schema, more granularly controlling user access.
    • Using schema-based migration, you can maintain relatively small table lists in each schema.


Cons:

    • The additional schemas you create using this option adds additional administrative overhead.



Migrate each folder using a different table prefix or postfix

If you choose this option, you’ll be adding a unique prefix or postfix to each table you migrate, to note which are used by which directory. Then, you’ll be creating and updating mds.ini files to match this structure, as well as migrating certain .INT files, so your application functions as expected.


Pros:

    • This option is the easiest to implement, as there’s less administrative overhead and maintenance to handle after your migration.
    • This option is flexible and works the same across all supported SQL backends.

Cons:

    • If you have a lot of directories and tables within those directories, your table list can become very large after adding prefixes/postfixes.
    • If you select this option, it will be harder to assign users directory access than it would be if you use one of the other options.
    • If you’re using Oracle, the 30 character limit on table identifiers can cause issues when attempting to assign prefixes/postfixes.


How to use the BTR2SQL GUI

After you weigh out the pros and cons of your migration options the next step is to get started! To get the step-by-step procedures you need in order to perform a multi-company migration, refer to the Multi-company migration of a Btrieve application using the BTR2SQL GUI white paper. 

Originally published November 13, 2014, and updated August 15, 2018

Legacy Application Modernization: Key Steps, Benefits & Best Practices

Legacy Application Modernization: Key Steps, Benefits & Best Practices

This blog post was co-authored with Riaz Merchant, President and CEO at Mertech. In the fast-paced software world, 'legacy' often signals a warning.

Read More
Hybrid Cloud Migration: Plan, Process and Advantages

Hybrid Cloud Migration: Plan, Process and Advantages

This post was co-authored with Riaz Merchant, President/CEO at Mertech Data Systems, Inc.

Read More
Financial Benefits of Cloud Migration & Hybrid Cloud Applications

Financial Benefits of Cloud Migration & Hybrid Cloud Applications

Shifting from your traditional legacy systems to the Cloud can be a game changer, as the benefits of cloud migration are numerous. Cloud computing...

Read More