如何将数据库从Filemaker迁移到Mysql?

发布于 2024-11-29 11:50:25 字数 221 浏览 1 评论 0原文

我正在重建一个基于Symfony1.4和MySQL 5.1的ERP系统。挑战在于以前的系统是在 Filemaker Pro 上构建的,我必须将以前的所有数据迁移到当前系统。为此,首先我需要将所有数据移动到具有完整的先前架构结构的 MySQL 数据库,然后我可以根据需要编写脚本将数据映射到当前系统架构。

我应该如何进行第一步?是否有现有的工具或流程可以做到这一点?

任何帮助将不胜感激!提前致谢!

I am rebuilding an ERP system based on Symfony1.4 and MySQL 5.1. The challenge is that previous system was built on Filemaker Pro and I have to migrate all previous data to current system. For that, first I need to move all the data to a MySQL DB having the previous schema structure intact and then I can map the data to the current system schema by writing a script as needed.

How should I proceed with that first step? Is there any existing tools or processes to do that?

Any help will be appreciated! Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

三月梨花 2024-12-06 11:50:25

最简单的方法是将 FileMaker 中的数据导出为某种通用格式。为此,您需要在 FileMaker 中打开文件,对于每个表,您需要转到与该表关联的布局,并使用菜单显示所有记录并导出。

确保仅导出数据字段(文本、数字、日期、时间和时间戳),因为 FileMaker 通常具有大量计算字段(计算和摘要)。 (要执行此操作,首先转到文件 - 定义数据库,然后转到某个表,按类型对文件进行排序,并记下最后一个数据字段。

这不会导出容器字段,但大多数应用程序不存储此类数据。这仍然是可能的也可以导出它们,但需要

使用自定义脚本。它是“下一个”,因为它不太方便,而且速度通常较慢。

如果您没有 FileMaker,则可以下载 30 天的版本。从他们的网站进行试用;它功能齐全。

The simplest way is to export data from FileMaker into some common format. To do this you need to open the file in FileMaker and for each table you need go to the layout associated with the table and use the menu to show all records and export.

Make sure to only export data fields (Text, Number, Date, Time, and Timestamp), because it's typical for FileMaker to have lots of calculated fields (Calculation and Summary). (To do this first go to File - Define Database, then to some table, sort files by type, and note the last data field.

This won't export container fields, but most apps don't store such data. It's still possible to export them too but it would require a custom script.

The next option is to use ODBC. It's 'next' because it's less convenient and usually slower.

If you don't have a copy of FileMaker, you can download a 30-day trial from their site; it's fully functional.

她比我温柔 2024-12-06 11:50:25

我现在正在使用 JDBC 在 Java 中执行此操作。您需要将 JDBC 驱动程序和 MySQL 导入到您的库中。我目前正在其他帖子中寻找处理如此大量数据的最佳实践。

您可能必须在 MySQL 中自己制作表格,我可能会推荐它,因为 FMPro 通常有一个奇怪的设置,您可能不想完全复制(我注意到最近一个文本字段必须也被设置为一个长度,否则事情就会变得混乱..)。一个轻松的下午,在 MySQL Developer(或者他们现在所说的任何东西)中绘制一些漂亮的图表?

这里有一些秘籍:

public static String dbaseURL = "jdbc:filemaker://machineIP:2399/database";

public static void FMProConnect() {

// Load the JDBC to ODBC driver
try {

    Class.forName("com.filemaker.jdbc.Driver");

} catch(java.lang.ClassNotFoundException e) {
        System.err.print("ClassNotFoundException: ");
        System.err.println(e.getMessage());
}
}
public static void copyTable(){
FMProConnection.FMProConnect();
Connection dbConnection = null;
Statement query = null;
PreparedStatement stmt = null;
    try {
      // Create a database connection
  dbConnection =
    DriverManager.getConnection(dbaseURL, "fmprouser", "fmpropassword");
  // Create a statement and execute the SQL query
  query = dbConnection.createStatement();
}
catch (SQLException e) {
  System.out.println("Error connecting to dbase.");
  e.printStackTrace();
  //System.exit(1);
}

ResultSet results = null;
try {

  results =
    query.executeQuery("SELECT * from table");

  // Iterate through the results and print them to standard output
     Connection con = DriverManager.getConnection("jdbc:mysql://mysqlserver.com/database","username","password");

  while (results.next()) {
    String fname = results.getString("field");
    String lname = results.getString("field1");
 // System.out.println("Found user \"" + fname + " " + lname + "\"");
  stmt = con.prepareStatement("INSERT ignore INTO table (field, field1 values (?, ?)");
  stmt.setString(1, fname);
  stmt.setString(2, lname);
  stmt.executeUpdate();

  }
  System.out.println("Completed Customers");
}
catch (SQLException e) {
  System.out.println("Error retrieving data from database.");
   e.printStackTrace();
  //System.exit(1);
}


}

I'm doing this in Java at the moment using JDBC. You need to import the JDBC driver and MySQL into your library. I'm currently looking in my other posts for the best practices to processing this large amount of data.

You might have to make the tables yourself in MySQL, and I might go as far as to recommend it, because FMPro typically has a strange setup, that you might not want to copy exactly (I noticed on the most recent one text fields have to be set to a length too or things just go haywire..). An easy afternoons work in MySQL Developer (or whatever they call it now) drawing some nice diagrams?

Here's some cheats:

public static String dbaseURL = "jdbc:filemaker://machineIP:2399/database";

public static void FMProConnect() {

// Load the JDBC to ODBC driver
try {

    Class.forName("com.filemaker.jdbc.Driver");

} catch(java.lang.ClassNotFoundException e) {
        System.err.print("ClassNotFoundException: ");
        System.err.println(e.getMessage());
}
}
public static void copyTable(){
FMProConnection.FMProConnect();
Connection dbConnection = null;
Statement query = null;
PreparedStatement stmt = null;
    try {
      // Create a database connection
  dbConnection =
    DriverManager.getConnection(dbaseURL, "fmprouser", "fmpropassword");
  // Create a statement and execute the SQL query
  query = dbConnection.createStatement();
}
catch (SQLException e) {
  System.out.println("Error connecting to dbase.");
  e.printStackTrace();
  //System.exit(1);
}

ResultSet results = null;
try {

  results =
    query.executeQuery("SELECT * from table");

  // Iterate through the results and print them to standard output
     Connection con = DriverManager.getConnection("jdbc:mysql://mysqlserver.com/database","username","password");

  while (results.next()) {
    String fname = results.getString("field");
    String lname = results.getString("field1");
 // System.out.println("Found user \"" + fname + " " + lname + "\"");
  stmt = con.prepareStatement("INSERT ignore INTO table (field, field1 values (?, ?)");
  stmt.setString(1, fname);
  stmt.setString(2, lname);
  stmt.executeUpdate();

  }
  System.out.println("Completed Customers");
}
catch (SQLException e) {
  System.out.println("Error retrieving data from database.");
   e.printStackTrace();
  //System.exit(1);
}


}
饮惑 2024-12-06 11:50:25

无需软件转换:
以下是一篇写得很好的文章的链接,展示了如何完全不使用软件从 FileMaker Pro 传输数据。

[http://drilix.com/ en/tutorial/sql-migrate-filemaker-mysql-without-any-software][1]

文件访问权限:
FileMaker 数据库文件可能不具有可见的导出功能。在 FileMaker 中,可以实施自定义菜单来禁用导出功能。要解决此类问题,您需要使用管理员帐户密码登录数据库,并具有[完全访问]权限。然后可以选择菜单:工具->自定义菜单->[FileMaker 标准 FileMaker 菜单]
选择此菜单后,所有常规菜单都将可用。

FileMaker 二进制文件格式:
重要的是要认识到 FileMaker 数据库使用专有的二进制文件格式来存储其数据。这些文件都不能在任何 Linux 或 UNIX 操作系统上直接读取,因为文件格式尚未公开。据我所知,除了 FileMaker Inc. 之外,只有一个人成功地对现代版本的文件格式(.fp7、.fmp12 版本)进行了逆向工程。

这意味着要从 FileMaker 数据库中提取数据,您必须始终让 FileMaker 软件在 MacOSX 或 Windows 上运行才能提取数据。这与读取 Access .mdb/.accdb 文件完全不同,对于后者,可以使用开源替代方案。

ODBC 与文件导出:
将数据从 FileMaker 导出为任何非本机文件格式时存在一些重要限制。 UTF8 格式的数据可能会丢失、某些格式的数据会被截断,以及重复字段数据会出现问题。这就是为什么我建议通过 ODBC 直接连接到 FileMaker,并将数据直接传输到 MySQL(或您选择的任何其他数据库)。

什么是重复字段?
FileMaker 中的重复字段类似于在单个记录的单个字段中存储数据数组。我通常建议将此数据分离到相关记录中,并通过父记录的主键进行关联。上面链接的 perl 脚本可以完成此任务。但您必须提前在 FileMaker 中准备好数据。由于 FileMaker 不再支持通过 ODBC 驱动程序重复字段,因此您需要在 FileMaker 中创建一个脚本,将所有重复值移动到第一个重复值中。
因此,如果您有一个重复值的字段,如下所示:

Field1[1]="abc"
Field1[2]="def"
Field1[3]="ghi"

您将数据移至:

Field1[1]="abc"<TAB>"def"<TAB>"ghi"

然后,您可以遍历 Field1[1] 中的制表符分隔值,将数据写入相关表中。

Converting without Software:
Here is a link to a well written article showing how to transfer data from FileMaker Pro using no software at all.

[http://drilix.com/en/tutorial/sql-migrate-filemaker-mysql-without-any-software][1]

File Access Permissions:
It is possible to have FileMaker database files with no visible export capability. Within FileMaker, custom menus can be implemented to disable the export features. To resolve this type of issue, you need to log into the database using the Admin account password, having [Full Access] privileges. Then you can select the menu: Tools->Custom Menus->[FileMaker Standard FileMaker Menus]
Once you select this menu, all of the regular menus will be available.

FileMaker Binary File Format:
It is important to realize that the FileMaker database uses a proprietary binary file format to store its data. None of these files can be read on any Linux or UNIX operating system directly, since the file format has not been made public. I know of only one person outside of FileMaker Inc. who has successfully reverse engineered the modern version of the file format (.fp7, .fmp12 versions).

This means that to extract data from a FileMaker database, you must always have the FileMaker software running on MacOSX or Windows in order to extract the data. This is completely different from reading Access .mdb/.accdb files, for which open source alternatives are available.

ODBC vs File Exports:
There are some important limitations to exporting data from FileMaker to any non-native file format. There can be loss of UTF8 formatted data, truncation of data with some formats, and issues with repeating fields data. This is why I recommend making a direct connection to FileMaker via ODBC, and transferring the data directly to MySQL (or any other database you choose).

What are repeating fields?
A repeating field in FileMaker is similar to storing an array of data within a single field of a single record. I generally recommend separating out this data into related records, related by the the primary key of the parent record. The perl scripts linked above, accomplish this task. But you must prepare the data within FileMaker in advance. Since FileMaker no longer supports repeating fields via their ODBC driver, you need to create a script in FileMaker to move all of the repeat values into the first repeat value.
So if you have a field of repeating values like this:

Field1[1]="abc"
Field1[2]="def"
Field1[3]="ghi"

You move the data into:

Field1[1]="abc"<TAB>"def"<TAB>"ghi"

Then you can iterate thru the TAB delimited values within Field1[1] to write the data into the related table.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文