When the target server cannot be reached directly, DBConvert can write its output to a file instead, which is later applied on the target machine. You pick a file-based destination on the connection screen: set the Output file path and the target Database name (plus Schema for Oracle and DB2). This page covers each format and how to apply it.
Note: File-based destinations are DBConvert-only - DBSync requires a live target connection.
Dump files
A dump file is a text file containing the SQL statements needed to recreate the database on the target server. Useful when direct connection to the server is not available.
Dump targets supported by DBConvert:
- SQL Server
- MySQL
- PostgreSQL
- Oracle
- Firebird
- DB2
Applying a dump on the target server
SQL Server: run the .sql file in Query Analyzer (SQL 2000) or SQL Server Management Studio (2005+).
MySQL:
# Windows
mysql.exe --host=HOST --user=USER --password=PASS -vvf DBNAME < dump.sql
# Unix
mysql -h HOST -u USER -p DBNAME < dump.sql
PostgreSQL:
psql -h HOST -U USER -d DBNAME < dump.sql
Dump files give you full control over when and how the data is loaded. DBConvert writes the SQL statements (CREATE + INSERT) to the file instead of streaming them to the server, so you can review, modify, or transport the file before applying.
MySQL dump options
- MySQL server version - controls the dump syntax. Older MySQL (< 3.23.6) restricts identifier names; pick "old" if you are unsure of the target version.
- Line breaks -
MS Windows stylefor Windows servers,Unix stylefor everything else. - Insert comments - add short comments to make the dump file more readable.
PHP scripts
A PHP script is functionally similar to a dump file, but written for execution on a web server with PHP and direct MySQL or PostgreSQL access.
Useful when:
- The database server is behind a firewall that only the web server can cross.
- You have shell or FTP access to the web server but not the database server.
Copy the generated script to the target web server (it embeds the connection credentials), open it in a browser or run it via CLI, and the data loads from there.
MS Visual FoxPro program files
A FoxPro program file (.prg) is a script in the FoxPro language that builds the database when executed.
Running a .prg in FoxPro
From the FoxPro command window:
DO path\to\file.prg
Example:
DO d:\projects\dataconversions\tests\dumps_foxpro\manydumps.prg
From the menu:
- File → Open, pick the
.prg. - Program → Do (or Ctrl+D) to execute.
Producing the program file
Set the Output file path for the .prg and the Database name the program will create. Options:
- Insert comments - add short comments to the generated
.prg. - Insert status messages - show the current operation in a window while the
.prgruns. - MS Visual FoxPro version - controls the syntax compatibility level.
Note: for FoxPro 8.0 and earlier the program is split across several files.