canmove, Confirmed users
345
edits
| Line 35: | Line 35: | ||
== How do I move a Bugzilla installation from one machine to another?== | == How do I move a Bugzilla installation from one machine to another?== | ||
Use mysqldump to make a backup of the bugs database. | |||
1. Use mysqldump to make a backup of the bugs database. | |||
For a typical Bugzilla setup, such a command might look like this: | For a typical Bugzilla setup, such a command might look like this: | ||
mysqldump -u(username) -p(password) bugs > bugzilla-backup.sql | |||
See the | See the | ||
[http://dev.mysql.com/doc/mysql/en/mysqldump.html mysqldump documentation] | [http://dev.mysql.com/doc/mysql/en/mysqldump.html mysqldump documentation] | ||
for more information on using the tool | 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] | [mysqldump] | ||
user=bugs | user=bugs | ||
password=mypassword | password=mypassword | ||
and then leave the ' | and then leave the '-u' and '-p' params out of the command line. | ||
On your new machine, follow the instructions found in | 2. On your new machine, follow the instructions found in | ||
[http://www.bugzilla.org/docs/tip/html/installing-bugzilla.html Chapter 2] | [http://www.bugzilla.org/docs/tip/html/installing-bugzilla.html Chapter 2] | ||
as far as setting up the physical environment of the new machine with perl, | as far as setting up the physical environment of the new machine with perl, | ||
webserver, modules, etc. | webserver, modules, etc. | ||
3. You have to preserve the <code>data</code> directory and <code>localconfig</code> 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 <code>localconfig</code> file before taking the next step. | |||
6. Copy the <code>bugzilla-backup.sql</code> 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 <code>bugzilla-backup.sql</code> 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 <code>max_allowed_packet</code> setting in your <code>my.cnf</code> (usually in <code>/etc/my.cnf</code>) 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 <code>--default-character-set=latin1</code> 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 <code>checksetup.pl</code>. Everything at this point works exactly like the normal "Upgrading" or "Configuration" sections from the [http://www.bugzilla.org/docs/ Bugzilla Guide]. | |||
== How do I migrate previous database to UTF-8 format?== | == How do I migrate previous database to UTF-8 format?== | ||