5 out of 8 rated this helpful - Rate this topic

Moving the Report Server Databases to Another Computer

You can move the report server databases that are used in a current installation to a SQL Server Database Engine instance that is on a different computer. Both the reportserver and reportservertempdb databases must be moved or copied together. A Reporting Services installation requires both databases; the reportservertempdb database must be related by name to the primary reportserver database you are moving.

Moving a database does not effect scheduled operations that are currently defined for report server items.

  • Schedules will be recreated the first time that you restart the Report Server service.

  • SQL Server Agent jobs that are used to trigger a schedule will be recreated on the new database instance. You do not have to move the jobs to the new computer, but you might want to delete jobs on the computer that will no longer be used.

  • Subscriptions, cached reports, and snapshots are preserved in the moved database. If a snapshot is not picking up refreshed data after the database is moved, clear the snapshot options in Report Manager, click Apply to save your changes, re-create the schedule, and click Apply again to save your changes.

  • Temporary report and user session data that is stored in reportservertempdb are persisted when you move that database.

SQL Server provides several approaches for moving databases, including backup and restore, attach and detach, and copy. Not all approaches are appropriate for relocating an existing database to a new server instance. The approach that you should use to move the report server database will vary depending on your system availability requirements. The easiest way to move the report server databases is to attach and detach them. However, this approach requires that you take the report server offline while you detach the database. Backup and restore is a better choice if you want to minimize service disruptions, but you must run Transact-SQL commands to perform the operations. Copying the database is not recommended (specifically, by using the Copy Database Wizard); it does not preserve permission settings in the database.

Important noteImportant

The steps provided in this topic are recommended when relocating the report server database is the only change you are making to the existing installation. Migrating an entire Reporting Services installation (that is, moving the database and changing the identity of the Report Server Windows service that uses the database) requires connection reconfiguration and an encryption key reset. For more information about migrating a Reporting Services installation, see Migration (Reporting Services).

If you can take the report server offline, you can detach the databases to move them to the SQL Server instance you want to use. This approach preserves permissions in the databases. If you are using a SQL Server 2008 database, you must move it to another SQL Server 2008 instance. After you move the databases, you must reconfigure the report server connection to the report server database. If you are running a scale-out deployment, you must reconfigure the report server database connection for each report server in the deployment.

Use the following steps to move the databases:

  1. Backup the encryption keys for the report server database you want to move. You can use the Reporting Services Configuration tool backup the keys.

  2. Stop the Report Server service. You can use the Reporting Services Configuration tool to stop the service.

  3. Start SQL Server Management Studio and open a connection to the SQL Server instance that hosts the report server databases.

  4. Right-click the report server database, point to Tasks, and click Detach. Repeat this step for the report server temporary database.

  5. Copy or move the .mdf and .ldf files to the Data folder of the SQL Server instance you want to use. Because you are moving two databases, make sure that you move or copy all four files.

  6. In Management Studio, open a connection to the new SQL Server instance that will host the report server databases.

  7. Right-click the Databases node, and then click Attach.

  8. Click Add to select the report server database .mdf and .ldf files that you want to attach. Repeat this step for the report server temporary database.

  9. After the databases are attached, verify that the RSExecRole is a database role in the report server database and temporary database. RSExecRole must have select, insert, update, delete, and reference permissions on the report server database tables, and execute permissions on the stored procedures. For more information, see How to: Create the RSExecRole.

  10. Start the Reporting Services Configuration tool and open a connection to the report server.

  11. On the Database page, select the new SQL Server instance, and then click Connect.

  12. Select the report server database that you just moved, and then click Apply.

  13. On the Encryption Keys page, click Restore. Specify the file that contains the backup copy of the keys and the password to unlock the file.

  14. Restart the Report Server service.

If you cannot take the report server offline, you can use backup and restore to relocate the report server databases. You should use the ‘Copy_Only’ option. Beginning in SQL Server 2008, SQL Server Management Studio supports copy-only backups. After you restore the databases, you must configure the report server to use the database on the new server instance. For more information, see the instructions at the end of this topic.

Using BACKUP and COPY_Only to Backup the Report Server Databases

When backing up the databases, set the COPY_OnlyL option and backup type to Full.

Note Note

Be sure to back up both the ReportServer and ReportServerTempDB databases as well as their associated log files.

For more information on using SQL Server Management Studio to backup a database, see How to: Back Up a Database (SQL Server Management Studio)

Using RESTORE and MOVE to Relocate the Report Server Databases

When restoring the databases, you can Use the RESTORE WITH NORECOVERY argument to perform the initial restore; this keeps the database in a restoring state, giving you time to review log backups to determine which one to restore. You would then repeat the RESTORE operation but use the RESTORE WITH RECOVERY argument.

Note Note

Be sure to restore both the ReportServer and ReportServerTempDB databases as well as their associated log files.

For more information on using SQL Server Management Studio to restore a database, see How to: Restore a Database Backup (SQL Server Management Studio)

How to Configure the Report Server Database Connection

  1. Start the Reporting Services Configuration tool and open a connection to the report server.

  2. On the Database page, click Change Database. Click Next.

  3. Click Choose an existing report server database. Click Next.

  4. Select the SQL Server that now hosts the report server database and click Test Connection. Click Next.

  5. In Database Name, select the report server database that you want to use. Click Next.

  6. In Credentials, specify the credentials that the report server will use to connect to the report server database. Click Next.

  7. Click Next and then Finish.

Note Note

A Reporting Services installation requires that the SQL Server Database Engine instance include the RSExecRole role. Role creation, login registration, and role assignments occur when you set the report server database connection through the Reporting Services Configuration tool. If you use alternate approaches (specifically, if you use the rsconfig.exe command prompt utility) to configure the connection, the report server will not be in a working state. You might have to write WMI code to make the report server available. For more information, see Reporting Services WMI Provider.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
rsReportServerNotActivated exception
We restored the report server databases from a different installation of Reporting Services to this new VM running Windows Server 2003 R2.  We went into the reporting Services configuration tool and re-connected to the databases.  We stopped and started the reporting services Service.  But the Report manager keeps returning "The report server installation is not initialized. (rsReportServerNotActivated) Get Online Help"
The feature: "Scale-out deployment" is not supported in this edition of Reporting Services.

When doing the manual restore method, I got the "The feature: "Scale-out deployment" is not supported in this edition of Reporting Services. (rsOperationNotSupported) (rsRPCError) " message. The following is from http://blogs.imeta.co.uk/swildgoose/Default.aspx and assisted me in resolving this error.

Restoring the reporting database from another machine will import the reporting services encryption keys from the source machine. Running the Standard (not Enterprise) version of Reporting Services with multiple encryption keys is not possible. Attempting to run the reports up in a website will result in the following error:
The feature: "Scale-out deployment" is not supported in this edition of Reporting Services. (rsOperationNotSupported) (rsRPCError)
This error message is essentially saying that running Reporting Services with multiple encryption keys is not possible without upgrading to Reporting Services Enterprise edition. Fortunately the solution (from http://support.microsoft.com/?kbid=842425) is simple.
Run
>> rskeymgmt -l
to determine the guid of the source encryption key. then run
>> rskeymgmt -r <src_id>
to remove the source key.

Scripts are buggy.

The original first uses 'with copy_only' which means you can't backup logs. The original second uses files made with a different script than the first.

First:

-- To permit log backups, before the full database backup, alter the database
-- to use the full recovery model.
USE master;
GO
ALTER DATABASE ReportServer
SET RECOVERY FULL

-- If the ReportServerData device does not exist yet, create it.
USE master
GO
EXEC master.dbo.sp_dropdevice @logicalname = N'ReportServerData'
GO
EXEC sp_addumpdevice 'disk', 'ReportServerData', 'C:\ReportServerData.bak'

-- Create a logical backup device, ReportServerLog.
USE master
GO
EXEC master.dbo.sp_dropdevice @logicalname = N'ReportServerLog'
go
EXEC sp_addumpdevice 'disk', 'ReportServerLog', 'C:\ReportServerLog.bak'

-- Back up the full ReportServer database.
BACKUP DATABASE ReportServer
TO ReportServerData
--WITH COPY_ONLY

-- Back up the ReportServer log.
BACKUP LOG ReportServer
TO ReportServerLog
-- WITH COPY_ONLY

-- To permit log backups, before the full database backup, alter the database
-- to use the full recovery model.
USE master;
GO
ALTER DATABASE ReportServerTempdb
SET RECOVERY FULL

-- If the ReportServerTempDBData device does not exist yet, create it.
USE master
GO
EXEC master.dbo.sp_dropdevice @logicalname = N'ReportServerTempDBData'
go
EXEC sp_addumpdevice 'disk', 'ReportServerTempDBData', 'C:\ReportServerTempDBData.bak'

-- Create a logical backup device, ReportServerTempDBLog.
USE master
GO
EXEC master.dbo.sp_dropdevice @logicalname = N'ReportServerTempDBLog'
go
EXEC sp_addumpdevice 'disk', 'ReportServerTempDBLog', 'C:\ReportServerTempDBLog.bak'

-- Back up the full ReportServerTempDB database.
BACKUP DATABASE ReportServerTempDB
TO ReportServerTempDBData
-- WITH COPY_ONLY

-- Back up the ReportServerTempDB log.
BACKUP LOG ReportServerTempDB
TO ReportServerTempDBLog
-- WITH COPY_ONLY

second:

--NOTE: It is not a best practice to put mdf-s or ldf-s on the OS drive or the same drive.

-- Restore the report server database and move to new instance folder
RESTORE DATABASE ReportServer
FROM DISK='C:\ReportServerData.bak'
WITH NORECOVERY,
MOVE 'ReportServer' TO
'G:\Databases\ReportServer\ReportServer.mdf',
MOVE 'ReportServer_log' TO
'D:\Databases\ReportServer\ReportServer_Log.ldf';
GO

-- Restore the report server log file to new instance folder
RESTORE LOG ReportServer
FROM DISK='C:\ReportServerLog.bak'
WITH NORECOVERY,
MOVE 'ReportServer' TO
'G:\Databases\ReportServer\ReportServer.mdf',
MOVE 'ReportServer_log' TO
'D:\Databases\ReportServer\ReportServer_Log.ldf';
GO

-- Restore and move the report server temporary database
RESTORE DATABASE ReportServerTempdb
FROM DISK='C:\ReportServerTempDBData.bak'
WITH NORECOVERY,
MOVE 'ReportServerTempDB' TO
'G:\Databases\ReportServer\ReportServerTempDB.mdf',
MOVE 'ReportServerTempDB_log' TO
'D:\Databases\ReportServer\ReportServerTempDB_Log.ldf';
GO

-- Restore the temporary database log file to new instance folder
RESTORE LOG ReportServerTempdb
FROM DISK='C:\ReportServerTempDBLog.bak'
WITH NORECOVERY,
MOVE 'ReportServerTempDB' TO
'G:\Databases\ReportServer\ReportServerTempDB.mdf',
MOVE 'ReportServerTempDB_log' TO
'D:\Databases\ReportServer\ReportServerTempDB_Log.ldf';
GO

-- Perform final restore
RESTORE DATABASE ReportServer
WITH RECOVERY
GO

-- Perform final restore
RESTORE DATABASE ReportServerTempDB
WITH RECOVERY
GO