Moving FogBugz On-Premises Databases to a New SQL Server Instance



Moving FogBugz On-Premises databases to a new SQL Server instance is straightforward: backup the current databases, restore them on the new server, provide access to it, then update the connection settings.



Backup the Databases

When you are moving to a new SQL Server instance, it is recommended to move all three On-Premise databases (fbhosted, trial1, FBODExportQueue).

When you are just restoring data from production to the test environment, you don't need to restore all three databases, just restore trial1, and update the connection settings.

  1. Backup the databases using SSMS.
  2. Take note of FogBugz' SQL Service user that has access to the databases.
    • If Windows Authentication is used (recommended), you will need to provide access to the same user on the new SQL Server insance.


    • If SQL Authentication is used, the given SQL user will need to have the same access rights.

For more information about the required database access levels read the Pre-Installation Checklist and Configuration Steps for FogBugz On-Premises Installation.


Restore the Databases on the new SQL Server Instance

  1. Restore the databases on the new SQL Server instance.
  2. Update the credentials on the new SQL Server, so the SQL Service user that is used by FogBugz to connect to its databases has the proper rights. This step applies whether te used authentication type is Windows or SQL.
  3. Once the trial1 database has been restored successfully, disable the active mailboxes. This gives you an opportunity to confirm the migrated data before pulling in new cases from any active mailboxes:

    UPDATE Mailbox SET fEnabled = 0 WHERE fDeleted = 0;


Update the Connection Settings


Update the Connection String in the Registry

  1. Identify your connection string on the Web Server.
  2. Update the Host Name of the SQL Server in the registry.


  3. If SQL authentication is used, and the name of the SQL user on the new server is different, update also the SQL user name in the connection string.


Update Settings in fbhosted Database

  1. Update site name, if it is different from the original site name.
    USE fbhosted;
    UPDATE tblFogBugzTrial 
      SET sUniqueSiteName = '<your-new-site-name>' 
    WHERE ixFogBugzTrial = 1;


  2. Update server instance name.
    USE fbhosted;
    UPDATE tblFogBugzTrialDBServer
      SET sSQLServerInstance = '<your-new-SQL-Server-instance-name>' 
    WHERE ixFogBugzTrialDBServer = 1;


  3. Update database file names.
    USE fbhosted;
    UPDATE tblFogBugzTrialDBServer
      SET sLocalPathToDBs ='<path-to-your-DB-files>',
          sUNCPathToDBs = '<UNC-path-to-your-DB-files>'
    WHERE ixFogBugzTrialDBServer = 1;


  4. Start (or restart) IIS so FogBugz Web Server applies the (new) connection settings.


Execute the Upgrade Tasks

If you are upgrading, execute the steps described in the article Upgrading FogBugz On-Premise.


Re-Enable the Mailboxes

Once you confirmed that the move to the new server has been successful, re-enable the mailboxes by running the following update on trial1 database:

UPDATE Mailbox SET fEnabled = 1 WHERE fDeleted = 0;


Back to the top