MdsMigrateFile¶
MdsMigrateFile is a command-line tool for migrating Btrieve files to SQL when no Data Definition Files (DDFs) are available. It runs a B_STAT command on the file to determine the file statistics and index structure, then issues a B_CREATE against the SQL backend to create the table.
Warning
MdsMigrateFile is intended as a last-resort proof-of-concept tool. It produces tables that work with the BTR2SQL drivers, but the resulting data is typically not usable in SQL by other applications or tools because fields that are not indexed are combined into FILLER fields. See Improving the Conversion below for better alternatives.
Command-line Syntax¶
Run MdsMigrateFile from a command prompt:
MdsMigrateFile.exe <BtrieveFileName> [configuration parameters]
The BtrieveFileName can include wildcards.
Configuration Parameters¶
All parameters are optional.
Parameter |
Description |
|---|---|
|
Owner name associated with the Btrieve file. Multiple |
|
Destination SQL server and optional port number. |
|
Destination database. |
|
Destination database schema. |
|
User name for server login (empty for trusted connection). |
|
Password for server login. |
|
Path and filename of the Mertech migration DLL ( |
|
Use field definitions from an existing INT file (rather than those returned by |
|
Number of worker threads to use when copying data. By default, multiple threads are used to speed up migration. Pass |
|
After the migration completes, read back the migrated data from the SQL backend and compare it to the original Btrieve file. Any mismatches are reported. Can be combined with a normal migration run. |
|
Run data validation without performing any migration. Reads the data from the SQL backend and compares it to the original Btrieve file. Useful for verifying an existing migration after the fact. |
|
Path and filename for trace output. |
|
Level of tracing ( |
Note
If the server, database, and/or login credentials are not provided, the mds.ini file, registry settings, or Login dialog box provide these details.
Note
During migration, INT files are created in the same location as the Btrieve file unless redirected by the INT-Folder setting in the mds.ini file.
Example¶
"C:\Program Files (x86)\Mertech Data Systems\DB Drivers\Btrieve\bin\MdsMigrateFile.exe" BILLING.MKD /server DEV-PC\SQLEXPRESS /database TestDB /trace mytrace /level 2
Comparison to the GUI Migration Utility¶
The table structure produced by MdsMigrateFile differs significantly from the structure produced by the GUI Migration Utility or MdsMigrateTable:
GUI Migration Utility / MdsMigrateTable — field names, field sizes, and data types match the information provided in the DDFs.
MdsMigrateFile — columns are strictly based on the index structure returned by
B_STAT. Fields that are not indexed are combined intoFILLERfields.
Below are two SQL table structures for the Pervasive Demodata file Billing.MKD:
GUI Migration Utility
MdsMigrateFile
Query results from the GUI Migration Utility version:
Query results from the MdsMigrateFile version:
Improving the Conversion¶
If you know the file structure, you can greatly improve the conversion by:
Creating DDFs and then using the GUI Migration Utility or MdsMigrateTable to migrate the file.
Copying an existing INT file for a similar file, renaming it to match your filename (e.g.,
Billing_MKD.INT), and then running MdsMigrateFile with the/force-int-usageflag:MdsMigrateFile.exe BILLING.MKD /server DEV-PC\SQLEXPRESS /database TestDB /force-int-usage /TrustedConnection /dll sql_btr.dll
Note
Contact Mertech Technical Support for assistance with this conversion process.
See Also¶
MdsMigrateTable — the recommended command-line migration tool (requires DDFs)