|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FileMaker Field Type |
MySQL Column Type |
| Text | VARCHAR(255) |
| Text | TEXT or LONGTEXT (if > 255 bytes) |
| Number | DOUBLE |
| Date/Time | DATE |
|
Date/Time - Time Data |
TIME |
| Container | LONGBLOB |
[Table 1 - FileMaker and MySQL Data Types]
FileMaker Date/Time fields can store Date or Time information and FileMaker 7 even includes a new Timestamp field which can be used for storing more precise Time data. However FileMaker does not provide any external way to query the database to determine which type of data is actually stored within the field. Therefore FmPro Migrator attempts to determine the type of stored data within the field based upon the name of the field. If a Date/Time field includes the text "time" within its name, it is migrated to a MySQL Time column. This behavior can be overridden by simply changing the field name within FileMaker so that FmPro Migrator doesn't see the text "time" within the name of the field.
Getting FileMaker Database Info
The first step in the migration process is to launch FileMaker 6, open the Example.fp5 database file and add a few records of sample data to the database. Make sure that the Local and Remote Data Access Companion plug ins are enabled and that file sharing is enabled for the Example.fp5 FileMaker database file. The FileMaker database filename will become the MySQL database table name.
Launch FmPro Migrator for Windows, click on the FileMaker
folder tab then select FileMaker 6 as the source database and MySQL
as the destination database. The ODBC DSN for the source database will
be used by FmPro Migrator to obtain metadata from the FileMaker database.
Either keep the default "example_fmp_dsn" ODBC DSN
name listed in FmPro Migrator or change it to match an existing FileMaker
ODBC System DSN on your computer.
Since I frequently perform migration projects for customers, I change the contents of the Customer field to reflect their name. The name within this field is used to create the Copyright information within each generated script, thus keeping my customer's legal department happy.
Click the Browse button to select an output directory for the migration scripts.

[Figure 3 - FileMaker Parameters]
Create the FileMaker ODBC DSN
Open the Windows Data Sources (ODBC) Control Panel to
create a new FileMaker 6 System DSN to match the ODBC DSN name entered
into FmPro Migrator for the source database. The Data Sources (ODBC)
control panel is located within the Administrative Tools folder of the
Windows Control Panel.
Note: With Windows XP, it may be necessary to select the Classic View
for the Control Panel in order to see the Administrative Tools folder.
![]() |
|
![]() |
[Figure 4 - Data Sources (ODBC) Control Panel]
This ODBC DSN should be created as a System DSN, so click
on the System DSN tab, then click the Add button.
Select the FileMaker Pro driver, then click the Finish button.
Note: If FileMaker 7 is being used as the source database then
the DataDirect 32-BIT SequeLink 5.4 driver would be selected.
![]() |
|
![]() |
[Figure 5 - Create New FileMaker Datasource]
Enter the name of the ODBC DSN in the first field. This
name should exactly match the name entered into the Source Database
ODBC DSN field within FmPro Migrator. It is not necessary to enter
the Remote Connection information unless the actual FileMaker database
file is being accessed from another computer. Click the Advanced tab
of the FileMakerPro ODBC Driver Setup panel.

[Figure 6 - Enter FileMaker ODBC DSN Name]
On the Advanced tab, change the Max Text Length from 255 to 65000. FileMaker 6 databases can store up to 64K of text within a text field, so this change in the ODBC Driver Setup panel insures that data is not truncated as it is read from the FileMaker database.
The Fetch Chunk Size determines how many records will
be retrieved from the FileMaker database at a time. When reading records
from the FileMaker database you will generally notice that 100 records
are retrieved, then there will be a pause while the next 100 records
are read from the database. This process will continue until all of
the records have been read. The default Fetch Chunk Size is 100, and
this value should generally not be increased. Increasing the ODBC Fetch
Chunk Size can cause FileMaker to crash while serving database files.
In fact this parameter may need to be reduced to as few as 10 records
if there are more than 500 fields within the FileMaker database file.
Click the Ok button.

[Figure 7 - FileMaker ODBC DSN Advanced Parameters]
Now that the FileMaker ODBC DSN has been created, FmPro Migrator can query the FileMaker database to obtain the metadata required for creating MySQL migration scripts. Click the Refresh button in FmPro Migrator. The example.fp5 database file opened in FileMaker 6 should show up in the Open Databases field.

[Figure 8 - FileMaker Open Databases]
Configuring MySQL Database Parameters
MySQL database parameters are entered on the FmPro Migrator "Other" tab. These parameters include hostname, TCP/IP port number, database name, username, and password information which will be used within the generated migration scripts.

[Figure 9 - MySQL Database Parameters]
Generating Migration Scripts
Press the Migrate button in FmPro Migrator to generate
migration scripts and database documentation files. Scripts which start
with the name of the original FileMaker database file(s) will then be
created within the output directory as shown below.

[Figure 10 - Generated MySQL Migration Files]
If these scripts are not created, select the Status Window menu item from the FmPro Migrator File menu. The Status Window will display info about any problems which occurred during the script generation process.

[Figure 11 - FmPro Migrator Status Window]
There are 10 files created for the migration process, but we will only need to use the 5 files which are described in Table 2.
| Filename | Description |
| example_instructions1.txt | This file contains detailed instructions concerning the migration process and is customized for the database which is currently being migrated. |
| example_report_mysql1.txt | This report file shows the structure of the FileMaker database, including the names of fields, and field types. This file also shows how the FileMaker fields will be renamed when creating the new MySQL database table. |
| example_create_table1.sql | The SQL file which creates the MySQL database table. |
| example_fmpro_max_fieldsize1.pl | The Perl script which reads each of the FileMaker records, then creates a report showing the maximum number of characters within each field. |
| example_fmpro_to_mysql_xfer_odbc1.pl | This Perl script reads the data from the FileMaker database and then writes the data into the MySQL database via an ODBC connection. |
[Table 2 - Migration File Descriptions]
Checking Field Sizes
Prior to creating the MySQL database table, it is necessary to determine
the maximum amount of data stored within each field of the FileMaker
database. This task is accomplished with the example_fmpro_max_fieldsize1.pl
script which is generated by FmPro Migrator.
Open the Windows Command Prompt by selecting Start >
Programs > Accessories > Command Prompt.
Use the cd command to navigate into the folder of generated scripts.
![]() |
|
![]() |
[Figure 12 - Opening Windows Command Prompt]
Run the example_fmpro_max_fieldsize1.pl program from the Windows command prompt to create the fieldsize report file.
perl example_fmpro_max_fieldsize1.pl
After this program finishes, it will produce the example_fmpro_max_fieldsize_report.txt
file. Examine the contents of the example_fmpro_max_fieldsize_report.txt
file to determine whether there are more than 255 characters of information
stored within any of the text fields of the FileMaker database file.
For this article, the FileMaker field named location is
used as an example of a text field which contains more than 255 characters.
To designate this field as a Large Text field, enter location
within the FmPro Migrator Large Text Fields field. Then press the Migrate
button to re-generate the migration scripts.

[Figure 13 - Defining Large Text Fields]
Creating the MySQL Table
Open the example_create_table1.sql file in a text editor. Using the fieldsize report you can determine the optimum size to use for each column of the new MySQL table. It is generally a good idea to reduce text column widths from the default value of VARCHAR(255) to be closer to the actual amount of data contained within the FileMaker database.
This particular FileMaker example includes a primary key field named asset_id. FmPro Migrator has automatically determined that this FileMaker database contains a primary key by looking for the first numeric field with the attributes of "Not Empty" and "Unique". Within the table creation SQL file, a primary key column has been created as UNSIGNED AUTO_INCREMENT NOT NULL, in order to provide an incrementing sequence upon record insertion. The table creation SQL code may be manually modified as needed prior to creating the MySQL database table. The best strategy to follow is to make any column name changes within the original FileMaker database, then regenerate the scripts with FmPro Migrator. In most cases there is no reason to try to manually track the dependencies between the generated output files, so just let FmPro Migrator recreate these files for you.
The example_create_table1.sql file makes use of LONGBLOB columns for storing FileMaker container field data as large binary objects within the MySQL database table.
For this example, the MySQL database is running on a Windows
server, but a remote connection can be made to a MySQL database running
on any operating system.
Execute the command listed at the top of this file to create the MySQL
database table.
mysql test -u user1 < example_create_table1.sql
Once the table has been created, its structure can easily
be verified with the graphical MySQL Administrator utility as shown
in Figure 14.

[Figure 14 - Verify MySQL Table Creation]
Migrating the Data
Now that the MySQL table has been created, the Perl DBI
program which transfers the data from FileMaker to MySQL can be run.
Run the example_fmpro_to_mysql_xfer_odbc1.pl script
from the Windows command prompt window to copy the data from the FileMaker
database to the new MySQL table.
As the script runs, each processed record number will be displayed on
the screen.

[Figure 15 - Migrating Data to MySQL]
The transferred data can be verified by using SQL commands in mysql or by using a graphical utility such as Navicat. Navicat is a graphical utility available for MacOS X, Windows and Linux for managing MySQL databases. Navicat also includes features to display and edit the contents of images in LONGBLOB columns, and text data within TEXT (memo) columns.

[Figure 16 - Verifying Migrated MySQL Data in Navicat]
This concludes the tasks involved with migrating a FileMaker 6 database to MySQL. The following sections include information regarding differences in the ODBC procedures involved with migrating a FileMaker 7 database to MySQL.
Installing the FileMaker 7 ODBC Driver
Note: The information within this section of the article is intended only for FileMaker 7 to MySQL migrations.
The introduction of FileMaker 7 represents the most significant upgrade for the FileMaker database product over the last ten years. This new version of the FileMaker database incorporates over 100 features with improvements to all major parts of the application. Some of these changes include the introduction of a new FileMaker database driver from DataDirect. This new FileMaker 7 ODBC driver is currently only available on the Windows platform.
FileMaker Pro 7 for Windows includes the DataDirect SequeLink ODBC driver which only allows a connection to the a FileMaker Pro 7 database from the localhost IP address - from the computer running the database. Unlike previous versions of FileMaker, the FileMaker Pro ODBC driver is no longer automatically installed along with the database software. A separate ODBC installer is launched from the xDBC folder on the FileMaker 7 CD in order to install the ODBC driver. Launch the DataDirect setup.exe installer from the FileMaker 7 installation CD. The default installation options may be used during the install process.

[Figure 17 - FileMaker 7 ODBC Installer]
Due to a problem with the ODBC installer, the DataDirect
SequeLink software needs to be installed twice in order to work correctly
on Windows.
Double-click the setup.exe installer again to remove the DataDirect
SequeLink software. Use the default options to de-install the software.
Double-click the setup.exe installer again to install the DataDirect
SequeLink software for the 2nd time. DataDirect 32Bit SequeLink will
now show up under the list of drivers within the the Microsoft ODBC
Administrator control panel.
Since we will be making an ODBC connection to a FileMaker 7 database, enable the ODBC/JDBC Sharing Companion for all users of the example.fp7 FileMaker 7 database.
![]() |
|
![]() |
[Figure 18 - Enabling FileMaker 7 ODBC/JDBC Sharing]
Creating the FileMaker 7 ODBC DSN
Open the Windows Data Sources (ODBC) Control Panel to
create a new FileMaker 7 System DSN to match the default ODBC DSN name
used by FmPro Migrator. Click the System DSN tab, then click the Add
button.

[Figure 19 - Create New FileMaker 7 DataSource]
Select DataDirect 32Bit SequeLink 5.4 as the driver for
the new FileMaker 7 data source, then click the Finish button.
Note: Do not select FileMaker Pro as the driver, because the
FileMaker Pro driver is only used for the older versions of the FileMaker
database.

[Figure 20 - Select DataDirect 32Bit SequeLink 5.4 Driver]
Enter the name of the ODBC DSN in the first field. This
name should exactly match the ODBC DSN name which was entered into the
ODBC DSN field for the Destination Database within FmPro Migrator.
Fill in the SequeLink Server Host (127.0.0.1), and SequeLink Server
Port (2399) fields as shown in the image below.
Note: The operational features of the FileMaker 7 ODBC Driver
are very different from previously shipped FileMaker ODBC drivers. The
DataDirect SequeLink FileMaker driver included with FileMaker Pro 7
only permits ODBC connections to be made to a local FileMaker 7 database
running on the same computer. This is why the SequeLink Server Host
field must be filled in with the TCP/IP address of 127.0.0.1 or the
hostname "localhost". The feature of allowing external computers
to make an ODBC connection to a FileMaker 7 database is reserved for
the FileMaker Server 7 Advanced product.
Click the ... button to the right of the Server
Data Source field, then select the name of the new FileMaker 7 database
(example). Click the Ok button.

[Figure 21 - Enter SequeLink Driver Parameters for FileMaker 7]
In order to verify that a connection can be made to the FileMaker 7 database, it is a good idea to test the ODBC connection before attempting to use the new ODBC DSN. DataDirect has provided a helpful Test Connect button within their driver setup window which enables the testing of ODBC database connectivity.
Click the Test Connect button shown in Figure 21 to verify
that a connection can be made to the FileMaker 7 database.
Enter Admin as the username, with no password, then click the
Ok button.
Click the Ok button to close the test results dialog box.
Note: If the connection test fails, verify that ODBC/JDBC sharing
is turned on and that an older version of FileMaker is not running with
the Local or Remote Data Access Companion plug-ins enabled.
![]() |
![]() |
[Figure 22 - Test FileMaker 7 ODBC DSN]
Conclusion
FileMaker Pro is a versatile and easy to use workgroup database application. But if you need functionality not included in FileMaker Pro such as better scalability, replication, or inexpensive hosting at an existing ISP, MySQL is an excellent alternative to consider. By simplifying the migration process from FileMaker Pro to MySQL, FmPro Migrator enables database developers to utilize the best database for their needs. Databases can be easily prototyped and tested with FileMaker Pro and then migrated to MySQL if the need arises.
![]()