How To Move Bugzilla From One Machine To Another
1. Shut down your Bugzilla by going to the Parameters page (under "Administration") and putting some text into the "shutdownhtml" parameter. (In Bugzilla 3.6 and later, this is in the "General" section of the Parameters. In earlier versions it will be on the first page when you open the Parameters screen.)
2. Use mysqldump to make a backup of the bugs database. For a typical Bugzilla setup, such a command might look like this:
mysqldump -u(username) -p(password) bugs > bugzilla-backup.sql
See the mysqldump documentation for more information on using the tool.
Note: Depending on the size of your database, and the power of your machine, the mysqldump command could be running long enough that the password would be visible to someone using the ps command. If you are on a multi-user machine, and this is a concern to you, create an entry in the file ~/.my.cnf that looks like this:
[mysqldump] user=bugs password=mypassword
and then leave the '-u' and '-p' params out of the command line.
3. On your new machine, follow the instructions found in Chapter 2 as far as setting up the physical environment of the new machine with perl, webserver, modules, etc.
4. You have to preserve the
data directory and
localconfig file from the old Bugzilla installation. So make sure to copy those from your old Bugzilla directory into your new Bugzilla directory. The new Bugzilla can be the same version you were running on the old server, or it can be a newer version.
5. If the new URL to your Bugzilla installation is different from the old one, you have to update the "urlbase" parameter in data/params (e.g. using a text editor). Else you may be redirected to your old installation when you log in.
6. If anything about your database configuration changed (location of the server, username, password, etc.) as part of the move, you'll need to update the appropriate variables in the
localconfig file before taking the next steps.
7. Copy the
bugzilla-backup.sql file from your old server to the new one.
8. Create an empty "bugs" database on the new server. First, log in to your MySQL server like:
mysql -u root -p
Enter your MySQL root pasword when prompted. Then create the database. If your old installlation was Bugzilla 3.2 or higher and had the "utf8" parameter turned on, then you need to do this command:
CREATE DATABASE bugs DEFAULT CHARACTER SET utf8;
If your old installation was before Bugzilla 3.2, or was Bugzilla 3.2 and higher with the utf8 parameter turned 'off, you must do:
CREATE DATABASE bugs DEFAULT CHARACTER SET latin1;
9. Exit MySQL, and import your
bugzilla-backup.sql file into your new "bugs" database:
mysql -u (username) -p(password) bugs < /path/to/bugzilla-backup.sql
If you get an error about "packet too large" or "mysql server has gone away", you need to adjust the
max_allowed_packet setting in your
my.cnf (usually in
/etc/my.cnf) file to be larger than the largest attachment ever added to your Bugzilla.
If there are any errors during this step, you have to drop the database, create it again using the step above, and do the import again.
Note: If you are importing from a version of MySQL earlier than 4.1, you have to specify
--default-character-set=latin1 when importing the dump, or your database will be very strange and possibly corrupted, when imported.
10. Change to the new Bugzilla directory and run
checksetup.pl, and do whatever it says to do.
11. Follow the normal "Configuration" section from the Bugzilla Guide to get Bugzilla running on the new machine.
12. In your browser, load http://your.bugzilla.installation/editparams.cgi (replace "your.bugzilla.installation" with the URL to your Bugzilla) and remove the text from the "shutdownhtml" parameter so that Bugzilla can be used again.