Bugzilla:Move Installation
How To Move Bugzilla From One Machine To Another
1. 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.
2. 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.
3. 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.
4. 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.
5. 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 step.
6. Copy the bugzilla-backup.sql file from your old server to the new one.
7. 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;
8. 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.
9. Change to the new Bugzilla directory and run checksetup.pl. Everything at this point works exactly like the normal "Upgrading" or "Configuration" sections from the Bugzilla Guide.