14

Is there a tool to export data from selected rows in a table with all data stored in other tables in other tables linked by relational design?

The purpose is to ease migrations of bits of data between servers for adhoc migrations. I am looking specifically for a tool for MySQL InnoDB with defined foreign keys.

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536
James McMahon
  • 243
  • 1
  • 2
  • 7

2 Answers2

11

In reality, you could just script it yourself using mysqldump.

Here my posts using the --where option for mysqldump:

With a good review of your tables and some SQL elbow grease, you can script the dump for any table and its child records with the corresponding foreign key references.

Give it a Try !!!

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536
0

This would be nigh impossible to accomplish in MySQL unless all tables had necessary FOREIGN KEY constraints defined (not guaranteed at all, considering MyISAM doesn't support them).

If all tables DID have the FK's, it would still be quite a task and I don't know of a tool that would export a subset.

I know Navicat will attempt to reverse engineer the relations, but I don't think it will dump a subset of the data.

Derek Downey
  • 23,568
  • 11
  • 79
  • 104