Many of the tables in the bailey db have foreign key constraints to other tables.
So, if I simply try to export an sql dump of one instance and import that into an existing instance, I get "foreign key constraint violation" errors.
SQL won't let me truncate a table which has a foreign key pointing to it from another table. Only solution I could come up with was to figure out the foreign keys for each table (by looking at the xsl export file), then in the destination DB drop the tables in reverse order of dependencies (so that for each table, I had already dropped any tables that had foreign keys pointing to that table). Then I could import the .sql file into the database containing no tables (and thus no constraints on tables).
Specifically, for Bailey
1) EXPORT dev database (e.g. dev_db.sql), ensure you include the "DROP TABLE" checkbox
2) EXPORT prod database (e.g. prod_db.sql), ensure you include the "DROP TABLE" checkbox
3) On production database:
3a) DON'T DROP this field
3b) drop fields in this order
FIELD HAS _id_fk POINTER TO FIELD(S)
execution_specials execution_mode, outcome
outcomes trial, outcome_normalized
respites trial, respite_delay, respite_punishment, respite_normalized
judge_respites trial, respite_delay, respite_punishment, respite_normalized
crimes trial, crime_normalized
mercy_appeals trial, mercy_appeal_who, mercy_appeal_why
trials trial_file, judge, jury
3c) import dev_db.sql (it may time out and tell you to upload again to continue) until you get "Import has been successfully finished" message
4) test to make sure everything is working.