This is a common need, since you may have initially installed the SpiraTeam database onto the same server and the IIS web server, but now need to move it to a dedicated database server.
To migrate your database, please follow these steps:
First temporarily stop the SpiraTeam application pool in IIS. This will stop users changing the data whilst you are doing the migration.
Next backup the live data of your current SpiraTeam database via SQL Server Management Studio (click on Tasks > Backup Database). Copy the newly created .BAK file to your new database server.
Make sure your database collation set to 'Latin1_General_CI_AS'
If you’re installing SpiraTeam version 7.2 or higher consider SQL Server 2016 installation as a minimum requirement
Please note, that the SpiraTest version should be the same on both machines (new and old) to get it restored properly.
For that, you need to:
- Upgrade the Spira to the latest on old machine first
- Install the new version on the new server
- Restore the database on the new server
Now restore the backup from the backup .BAK file onto the new database server with the same database name that it had before (e.g. SpiraTeam).
Next run the following SQL command to relink the SpiraTeam SQL Server login with the SQL Server user (otherwise the DB will throw an error):
- Using SQL Server Authentication
use SpiraTeam
GO
EXEC sp_change_users_login 'Update_One', 'SpiraTeam', ' SpiraTeam'
GO
- Using Windows Authentication Server200x//Vista/7/10/11/Server201x/Server202x
USE SpiraTeam
GO
ALTER USER SpiraTeam WITH LOGIN = [NT AUTHORITY\NETWORK SERVICE]
GO
8. Once you have relinked the logins, open up the Web.Config file on the SpiraTeam web service (usually in C:\Program Files\SpiraTeam folder) and change the database server name in the following section:
<connectionStrings>
<add name="SpiraTestEntities" connectionString="metadata=res://DataModel/SpiraDataModel.csdl|res://DataModel/SpiraDataModel.ssdl|res://DataModel/SpiraDataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=SERVERNAME\INSTANCENAME;initial catalog=SpiraTeam;integrated security=True;multipleactiveresultsets=True;App=EntityFramework;Connection Timeout=30"" providerName="System.Data.EntityClient" />
</connectionStrings>
9. Once that is done, start the SpiraTeam application pool in IIS
You should now be able to access the system with the new database server.