Question

I need to export information from a legacy database system. The database is a 'Progress' database and the information is stored in a file with extension .b1

What is the easiest way to export all database tables to a text file?

Was it helpful?

Solution

The .b1 file is a a part of the Progress Database but actually not the database itself. It contains the "before-image" data. It is used for keeping track of transactions so that the database can undo in case of error/rollback etc. The data in that file will really not help you.

What you would want are the database files. Usually named .db, .d1, .d2, d3 etc.

However reading those (binary) files will be very tricky. I'm not even sure there are any specifications on how they are built. It would be a lot easier to use the Progress built in tools for dumping all data as textfiles. Those textfiles could easily be read by some simple programs in Python. If you have the database installed on a system you will find a directory with programs to serve the database etc. There you will also find some utilities.

Depending on version of OS and of Progress it might look a bit different. You would want to enter the Data Administration utility and go into Admin => Dump Data and Definitions.

Progress Data Administration Screenshot

If you take a look at the resulting files .df for data definitions (schema) and .d for the data itself you should be able to work out how it's formatted. Relations are not stored in the database at all. In a Progress environment they basically only exists in the application accessing the DB.

You can also select Export Data for various formats ("Text" is probably most interesting).

If you programatically can access the Progress environment it might even be easier to write a small program that exports individual tables. This will create a semicolon delimited file for "table1":

OUTPUT TO C:\temp\table1.txt.
FOR EACH table1 NO-LOCK:
  EXPORT DELIMITER ";" table1.
END.
OUTPUT CLOSE.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top