Skip to content

cuxs/DBFToPostgreSQL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBF To PostgreSQL

This script imports DBASE/FoxPro files, located in a subdir, into a MySQL database. It can be used for reverse engeneering of FoxPro applications. For OS/X and Linux, I didn't find any usefull and working tool to do this automatically.

This script is based on:

Installation and use

  • Install php-xbase and this library from Github in the same directory. The dbase extension for PHP don't read MEMO data (or do it badly), so php-xbase is needed.
git clone https://github.com/hisamu/php-xbase.git
git clone https://github.com/jorgecasas/DBFToMySQL.git
  • Configure MySQL info and paths to directory where DBF/PFT files are located in configuration file config.php

  • Use it:

php dbf-import.php

Known-issues


  • if a date field is 0, then the the corresponding date with 0 is inserted (january first, 1970).
  • the php-xbase thing is in the subdir "classes". As a ruby programmer, i didn't find how to make this separate whithin the day, I spent on solving this problem. If someone can help me with this problem.

License

Differences with DBF To MySql

  • Nows it generates a script per table in a folder called convertedTables. It does not run the migration automatically.
  • Keep in mind that we are generating a script with no COPY instruction but a multiple INSERT INTO VALUES.
  • You can migrate the tables running this inside convertedTables: cat table1.sql table2.sql ... | psql -U <user> --password <databaseName>

License

MIT

About

xbase/dbf to PostgreSQL import tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%