Move FogBugz to another server
This guide addresses a variety of server/database scenarios, and makes reference to the Accessories and FileUploads directories, both of which are in your FogBugz directory. The following scenarios assume that you will be using the same database after moving; if not, please consult the following web pages to convert Access to MySQL, convert Access to SQL Server, or convert SQL Server to MySQL.
You can continue to use the old FogBugz installation until the new one is set up with licenses installed; then, cease using the old FogBugz, move your database (if applicable), and point the new FogBugz installation to your FogBugz database.
By the same token, it is possible to move and upgrade FogBugz at the same time. As of FogBugz 5, all the information FogBugz needs to run is stored in the database. When FogBugz is run against any outdated FogBugz database, it will offer to upgrade that database on first load. While we do recommend that you upgrade in place before moving (to minimize the number of things changing at each step) you can just move the database and point a higher version of FogBugz at that database.
If you use PHP FogBugz (Linux/Mac):
- Run Setup on the new machine and install a new fogbugz database.
- Get everything working so you know the install succeeded with this new database.
- When you are sure FogBugz is completely installed correctly, stop mysql on the new server and replace the fogbugz mysql database folder with the fogbugz mysql database folder from your other machine. You can also run mysqldump and backup the db on one machine, drop the newly created fogbugz database, and import your mysqldump file.
- Run these two commands in mysql (replacing yourpassword with the actual fogbugz mysql user password, and your.host.name with the host name of your mysql server):
- GRANT ALL PRIVILEGES ON fogbugz.* TO fogbugz@localhost IDENTIFIED by 'yourpassword' WITH GRANT OPTION
- GRANT ALL PRIVILEGES ON fogbugz.* TO fogbugz@'your.host.name' IDENTIFIED by 'yourpassword' WITH GRANT OPTION
- FogBugz should be up and running now!
If you use Access as your database on Windows:
- Run Setup on the new machine. Select Access as your database.
- Do not install the licenses yet (don't worry if you already did)
- Delete the empty FogBugz.mdb file that Setup has created for you in the FogBugz/Accessories folder.
- Cease using the old FogBugz.
- Stop the maintenance service on the old FogBugz server: open the Services control panel in the Administrative Tools menu and stop the Fog Creek Maintenance service.
- Copy FogBugz.mdb from the old machine to the new machine, in the Accessories folder.
- Be sure the FogBugz anonymous access account in IIS in this new install has full access to this file.
- Install your licenses on the new box. (Note that your licenses are not tied exclusively to one server; licensing guidelines do permit multiple simultaneous FogBugz installations.)
- Versions before 5.0: Copy over the FileUploads folder to the new machine. This contains your case attachments!
- All set!
If you use MySQL as your database on Windows:
- Run Setup on the new machine. Select Access as your database (even though you are installing for MySQL)
- Install your licenses. (Note that your licenses are not tied exclusively to one server; licensing guidelines do permit multiple simultaneous FogBugz installations.)
- Stop the maintenance service on the old FogBugz server: open the Services control panel in the Administrative Tools menu and stop the Fog Creek Maintenance service.
- Move the FogBugz MySQL database to the new machine. You can either copy the data folder from the MySQL databases folder, or use mysqldump to export and import your database.
- Do not copy the id.frm file (or if you do, delete the ID table after copying). FogBugz will recreate this table for you.
- Create an ODBC DSN pointing at your new MySQL database - detailed here
- Log into your new FogBugz as an admin. Click on Site (top right). Change "Database" to use the ODBC DSN you just created
- Versions before 5.0: Copy over the FileUploads folder to the new machine. This contains your case attachments!
- All set!
If you use SQL Server, and you are not moving your SQL Server installation:
- Run Setup on the new machine.
- If in your old install you are/were using Windows authentication when connecting to your database, using a domain account for the FogBugz IIS user, you may want to specify that same user account here in your new installation to simplify your switch-over.
- Select Access as your database.
- Install your licenses. (Note that your licenses are not tied exclusively to one server; licensing guidelines do permit multiple simultaneous FogBugz installations.)
- Cease using the old FogBugz.
- If you have mailboxes configured in your old FogBugz, stop the Fog Creek Maintenance Service on the old FogBugz server: open the Services control panel in the Administrative Tools menu and stop the Fog Creek Maintenance service. Set the startup type to disabled so it doesn't try to run if you reboot the machine.
- Log into your new FogBugz as an admin. Click on Site (top right). Change "Database" to SQL Server and enter the server name and database name of your existing database. If you use SQL Server authentication only, choose the ODBC string and specify the uid and pwd, etc. Before you click OK, double check everything. If using uid and pwd, are you sure the connection string is right? If using "Integrated Security" or not using the ODBC string option at all: does the anonymous access account for FogBugz in IIS have a valid Windows login in SQL Server? Does that login have db_owner rights on the FogBugz database?
- Delete the empty FogBugz.mdb file that Setup created for you in the FogBugz/Accessories folder.
- Versions before 5.0: Copy over the FileUploads folder to the new machine. This contains your case attachments!
- All set!
If you use SQL Server, and you are moving your SQL Server installation:
- Run Setup on the new machine. Select SQL Server as your database.
- Do not install the licenses yet.
- Cease using the old FogBugz.
- If you have mailboxes configured in your old FogBugz, stop the Fog Creek Maintenance Service on the old FogBugz server: open the Services control panel in the Administrative Tools menu and stop the Fog Creek Maintenance service. Set the startup type to disabled so it doesn't try to run if you reboot the machine.
- Now you need to move the database. Run SQL Enterprise Manager (on or connected to the old db server). Right click your FogBugz database, choose All Tasks, and click Detach Database.
-
Using Enterprise Manager on or connected to your new server, drill down to the empty
FogBugz database that was created by Setup. Select it and press the Delete key to delete it.

-
Right click the Databases item, choose
All Tasks, and click Attach Database. In the dialog which appears, click
"..." and select your MDF file
. In the Specify database owner
dropdown, choose the FogBugz account that you created or chose
during Setup. Click OK.
![[Image]](../../../FogBugz/KB/dbsetup/images/5.gif)
- Bring up FogBugz in your web browser. If at this point you get an error message, please re-read the above steps and verify that you didn't do something differently. Running setup creates an empty database named FogBugz and points to that, so if your database that you copied over has a different name, you will need to specify that name by editing the registry.
- Install your licenses.
- Go to the site page and verify the information in your site settings and be SURE to hit OK on that page so FogBugz saves that information (this is important, even if everything already looks ok, hit the OK button). Be sure that your FogBugz Maintenance URL is reachable and correct.
- Versions before 5.0: Copy over the FileUploads folder to the new machine. This contains your case attachments!
- All set!
AFTER YOU MOVE FOGBUGZ: To be sure that permissions on the FogBugz account are correct, please step through this guide. If anything is wrong with the permissions, everything may look fine at first but problems may show up later, e.g. case attachments may fail.
