User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:db_dump_restore

Information originally from djcarr in bug #8407 here


After more investigation I've come up with a set of good guidelines for dumping and importing fairly large mantis databases. I'll post them here in case they can help someone else.

  • 1. In MySQL Server's my.ini set the following. This allows file attachments greater than 1MB to be imported back in.
[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. These options ensure one line per row, again for ease of reading and splitting the dump if needed.
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. The Query Browser chokes badly on the many '/ escapings that mysqldump places in the bug text and descriptions.

mantisbt/db_dump_restore.txt · Last modified: 2008/10/29 04:25 by 127.0.0.1

Driven by DokuWiki