FoxPro and dBase .dbf files: what they are and how to open them

If your business application uses a folder full of .dbf files, it is probably built in Visual FoxPro, dBase or Clipper. That data is accessible and can be migrated, but there are details (memos, indexes, character sets) worth knowing before touching anything.

What is in a FoxPro folder

.dbf

Each data table. It is the dBase format, also used by FoxPro and Clipper.

.fpt and .dbt

Memo fields (long text or binary) that do not fit in the .dbf. Without them that data is lost.

.cdx, .idx and .ntx

Indexes. They can be rebuilt, but a damaged index causes odd results in the application.

.dbc, .dct and .dcx

Visual FoxPro database container: relationships, rules and views stored outside the tables.

How to open them and extract the data

Copy the whole folder

The .dbf, .fpt and index files must stay together. Always work on the copy.

Open them with a tool that reads them

LibreOffice Calc opens .dbf files. There are also free viewers, and libraries such as dbfread (Python) to process them.

Check the character set

If accents and special letters come out wrong, the table uses an old code page (for example 850 or 1252) and you must specify it when reading.

Migrate to a current database

Tools such as pgdbf load .dbf tables into PostgreSQL. Then counts and totals are verified.

Recover the program rules

The data is only one part: the logic lives in the executable. Analyse it with the free analyser to see whether it is recoverable.

Common pitfalls

Deleted records

In the dBase format a deleted record stays in the file marked as removed. You have to decide whether to migrate it.

Dates and numerics

Empty dates and numeric fields containing spaces cause errors when loading into a strict database.

Scattered data

The application may read files from other folders or the network. It is worth inventorying where it reads from and writes to.

We only work on software you own or have the right to act on. This is not legal advice.

Frequently asked questions

Can I open a .dbf in Excel?

Depending on the Office version and the type of .dbf, it may or may not open. LibreOffice Calc or a dedicated viewer are more reliable ways to look at the data.

Can the code of the FoxPro program be recovered?

In many cases an important part can be recovered from the executable, unless it was compiled with encryption. We assess it in the assessment.

Does Visual FoxPro still work?

Applications keep working as long as they have their runtime, but Microsoft stopped supporting Visual FoxPro. The risk lies in the machines and systems around it.

What do you migrate a FoxPro application to?

Usually to a web application with PostgreSQL or another current database, keeping the business rules and verifying that the data matches.

Related

Contact

Email: jmoreno@stellariscode.com · Phone: +34 654 51 63 65