mantisbt:db_dump_restore
Differences
This shows you the differences between two versions of the page.
| mantisbt:db_dump_restore [2008/01/07 08:15] – created thraxisp | mantisbt:db_dump_restore [2008/10/29 04:25] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | Information originally from djcarr in bug #8407 [[http:// | ||
| + | ---------------------------------------------------------------------- | ||
| + | After more investigation I've come up with a set of good guidelines for | ||
| + | dumping and importing fairly large mantis databases. | ||
| + | in case they can help someone else. | ||
| + | |||
| + | * 1. In MySQL Server' | ||
| + | |||
| + | [mysqld] | ||
| + | max_allowed_packet=16M | ||
| + | |||
| + | * 2. Dump the file attachments table alone in hex format. | ||
| + | |||
| + | mysqldump --host=*** --user=*** --password=*** --hex-blob --skip-extended-insert --result-file=mantisdb_files.sql mantisdb mantis_bug_file_table | ||
| + | |||
| + | Why? Because this one table can get very big and MySQL Server cannot | ||
| + | reimport scripts more than about 50MB. So you can then split this table | ||
| + | dump into multiple smaller files if needed. | ||
| + | |||
| + | * 3. Dump the remainder of the database. | ||
| + | |||
| + | mysqldump --host=*** --user=*** --password=*** --skip-extended-insert --ignore-table=mantisdb.mantis_bug_file_table --result-file=mantisdb.sql mantisdb | ||
| + | |||
| + | * 4. Import the files in sequence into the NEW database: | ||
| + | |||
| + | mysql --host=*** --user=*** --password=*** newmantisdb < mantisdb_files.sql | ||
| + | mysql --host=*** --user=*** --password=*** newmantisdb < mantisdb.sql | ||
| + | |||
| + | Do NOT use the MySQL Query Browser GUI to import - use the command line | ||
| + | as above. | ||
| + | mysqldump places in the bug text and descriptions. | ||
| + | |||
