Given a MySQL database and a set of corresponding active record models similar to:
Test -< Categories -< Questions
I need a way to quickly dump the contents of Test #1 to a file, and then restore on a separate machine. When Test #1 is reinstantiated in the database, all of the relational data should be intact (all foreign keys are maintained, the Categories, Questions for the test are all restored). What’s the best way to do this?
Try the Jailer subsetting tool. It’s for dumping subsets of relational data, keeping referential integrity.