For a job, I had to migrate an old MS DOS based Dataflex database to PostgresSQL. After a few months, I found a way to get the table structures and the data out of the files. Once I had the data, I wrote a few scripts in Ruby. One of them converts the Dataflex file layout to multiple SQL create table statements. Another one, converts the data extracted from the database to insert statements. They work very well and I have used them about 4 times for conversions and have gotten the process down to just a weekend, therefore, minimizing down time for clients.
If you are planning on attempting this task yourself here are some valuable tips:
- Do not export or record OVERLAPs. They are in essence the way dataflex recognizes multiple column primary/foreign keys.
- Export your data to Line Delimited Format. Not CSV or Tab separated.
- Don’t edit columns or tables until all the data is migrated.
I might edit this post later to give some examples.
If you would like to contact me, please click the contact link to leave me a message.
July 24th, 2008 → 12:11 pm @ Jason Pope