Replicating a Bugzilla database structure
Gervase Markham
gerv at mozilla.org
Mon Jul 6 13:18:14 UTC 2015
Let's say you want to make a copy of a Bugzilla database's structure -
i.e. all the data and configuration (products, components etc.), but not
the bugs or attachments. This is handy if you are setting up a test
system for a production server with a large databsae.
Try this (with appropriate auth credentials):
# Extract table structure but no data at all
mysqldump -u bugzilla -p --add-drop-database --add-drop-table --no-data
bugzilla > skeleton.db
# Extract table data of all tables except those relating to bugs and
attachments and other temporary stuff
mysqldump -u bugzilla -p --no-create-info
--ignore-table=bugzilla.attachments --ignore-table=bugzilla.attach_data
--ignore-table=bugzilla.bug_group_map
--ignore-table=bugzilla.bug_see_also --ignore-table=bugzilla.bug_tag
--ignore-table=bugzilla.bugs --ignore-table=bugzilla.bugs_activity
--ignore-table=bugzilla.bugs_fulltext --ignore-table=bugzilla.cc
--ignore-table=bugzilla.dependencies --ignore-table=bugzilla.duplicates
--ignore-table=bugzilla.flags --ignore-table=bugzilla.keywords
--ignore-table=bugzilla.longdescs --ignore-table=bugzilla.series_data
--ignore-table=bugzilla.votes --ignore-table=bugzilla.audit_log bugzilla
> data.db
Then send the two files you've created back to mysql, in the order you
created them.
Hope this helps someone. If you know a better way of doing this, do post it.
Gerv
_______________________________________________
dev-apps-bugzilla mailing list
dev-apps-bugzilla at lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-apps-bugzilla
More information about the developers
mailing list