Move SQL Reporting Services to Another Server

By:   |   Comments (20)   |   Related: > Reporting Services Administration


Problem

You need to migrate a SQL Server Reporting Services (SSRS) Native Mode environment installed on one server and move it all to another server. Check out this tip to learn the steps.

Solution

Let's walk through the steps.

The high-level overview is:

  • Backup SSRS databases on source server
  • Backup Encryption Key on source server
  • Restore SSRS databases on target server
  • Restore Encryption Key on target server
  • Remove old server name from the Keys table on the target server
  • Test

These are the versions and editions I used, but you can follow these steps for other versions and editions.

  • Windows 10
  • SQL Server 2012 Developer Edition (source)
  • SQL Server 2017 Developer Edition (target)

Source Server

We'll use a very simple example of an SSRS Server with one Folder, one Report and one Subscription. The steps are the same whether it's one or one-thousand reports so we'll keep it simple.

Here's the MyReports Folder with MyReport.

Source SSRS Server Report

And here's the Subscription that automatically runs MyReport.

Source SSRS Server Report Subscription

Edit the directory you want to use for your backup files here and execute to backup databases ReportServer and ReportServerTempDB.

-- backup ReportServer
BACKUP DATABASE [ReportServer] 
TO  DISK = N'C:\backups\ReportServer_migration.bak' -- edit backup directory and file name
WITH INIT,  
NAME = N'ReportServer-Full Database Backup', 
SKIP, 
COMPRESSION,  
STATS = 10
GO
 
-- backup ReportServerTempDB
BACKUP DATABASE [ReportServerTempDB] 
TO  DISK = N'C:\backups\ReportServerTempDB_migration.bak' -- edit backup directory and file name
WITH INIT,  
NAME = N'ReportServerTempDB-Full Database Backup', 
SKIP, 
COMPRESSION,  
STATS = 10
GO

Backup the encryption key by opening the Reporting Services Configuration Manager on the source server

  1. Encryption Keys
  2. Backup
  3. Enter directory and file name
  4. Give it a password that meets your domain requirement
  5. Confirm password
  6. Click OK
Backup Encryption Key

Target Server

Open the Reporting Services Configuration Manager on the new server.

  1. Click Stop to stop Reporting Services
Stop SSRS

Copy the backup files from the source to the target server.

Edit the following code with the path to your backup files, and path to the physical database files in the following and execute to restore the two databases. (Note, everything is pointing to C:\ here as I'm testing this on one laptop with 2 named instances of SQL Server. Good place to test, but you'll most like be doing this on actual servers.)

-- Restore ReportServer
USE [master]
RESTORE DATABASE [ReportServer] 
FROM DISK = N'C:\backups\ReportServer_migration.bak' -- edit backup directory and file name
WITH  FILE = 1,  
-- edit physical file path
MOVE N'ReportServer' TO N'C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\MSSQL\DATA\ReportServer.mdf',  
MOVE N'ReportServer_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\MSSQL\DATA\ReportServer_log.ldf',  
NOUNLOAD,  
REPLACE,  
STATS = 5
GO
 
-- update compat level
ALTER DATABASE [ReportServer] SET COMPATIBILITY_LEVEL = 140
GO
 
-- set db owner to sa
USE [ReportServer]
GO
ALTER AUTHORIZATION ON DATABASE::[ReportServer] TO [sa]
GO
 
-- dbcc
dbcc CHECKDB([ReportServer]) WITH NO_INFOMSGS
 
-- Restore ReportServerTempDB
USE [master]
RESTORE DATABASE [ReportServerTempDB] 
FROM DISK = N'C:\backups\ReportServerTempDB_migration.bak' -- edit backup directory and file name
WITH  FILE = 1,  
-- edit physical file path
MOVE N'ReportServerTempDB' TO N'C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\MSSQL\DATA\ReportServerTempDB.mdf',  
MOVE N'ReportServerTempDB_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\MSSQL\DATA\ReportServerTempDB_log.ldf',  
NOUNLOAD,  
REPLACE,  
STATS = 5
GO
 
-- update compat level
ALTER DATABASE [ReportServerTempDB] SET COMPATIBILITY_LEVEL = 140
GO
 
-- set db owner to sa
USE [ReportServerTempDB]
GO
ALTER AUTHORIZATION ON DATABASE::[ReportServerTempDB] TO [sa]
GO
 
-- dbcc
dbcc CHECKDB([ReportServerTempDB]) WITH NO_INFOMSGS
  
-- sp_helpdb
EXEC sp_helpdb [ReportServer]
EXEC sp_helpdb [ReportServerTempDB]

At this point we need to be sure the logins and users are in sync, but we'll digress briefly to show what happens if you omit this step. Go back to the Report Server Configuration Manager.

  1. Click Start to start the service
Start SSRS

The service starts and it appears to be working, but we have this is the error log:

SQL Server errorlog

For our example we're using the default accounts to run the services on both our source and target SSRS servers. The user will not show up in Management Studio because there is no associated login with it so it's essentially orphaned but you can see it by querying sys.sysusers in each database.

SELECT name FROM [ReportServer].[sys].[sysusers]
SELECT name FROM [ReportServerTempDB].[sys].[sysusers]

We don't really have to delete the orphaned users, but let's do some housekeeping while we have the chance.

USE [ReportServer]
GO
DROP SCHEMA [NT SERVICE\ReportServer$SQL2012]
GO
DROP USER [NT SERVICE\ReportServer$SQL2012]
GO
 
USE [ReportServerTempDB]
GO
DROP SCHEMA [NT SERVICE\ReportServer$SQL2012]
GO
DROP USER [NT SERVICE\ReportServer$SQL2012]
GO

Now we're ready to add our users and assign them to the proper groups.

-- master
USE [master]
GO
CREATE USER [NT SERVICE\SQLServerReportingServices] 
FOR LOGIN [NT SERVICE\SQLServerReportingServices] 
WITH DEFAULT_SCHEMA=[NT SERVICE\SQLServerReportingServices]
GO
 
ALTER ROLE [RSExecRole] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO
 
-- msdb
USE [msdb]
GO
ALTER ROLE [RSExecRole] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO
ALTER ROLE [SQLAgentOperatorRole] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO
ALTER ROLE [SQLAgentReaderRole] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO
ALTER ROLE [SQLAgentUserRole] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO
 
-- ReportServer
USE [ReportServer]
GO
ALTER ROLE [db_owner] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO
ALTER ROLE [RSExecRole] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO
 
-- ReportServerTempDB
USE [ReportServerTempDB]
GO
ALTER ROLE [db_owner] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO
ALTER ROLE [RSExecRole] ADD MEMBER [NT SERVICE\SQLServerReportingServices]
GO

Start and stop SSRS again.

Check for errors in the error log and there should not be any more login failures.

EXEC sp_readerrorlog

Look for NT SERVICE\SQLServerReportingServices connections.

EXEC sp_who 'NT SERVICE\SQLServerReportingServices'

And we expect to see something like this.

sp_who

Go back to the Report Server Configuration Manager.

  1. Encryption Keys
  2. Restore
  3. Fully qualified file name of Encryption Key backup from the source server
  4. Password
  5. Click OK
Restore Encryption Key

You should see the restore was successful and Reporting Services was restarted.

Encryption Key restored and SSRS restarted

If you're on SQL Server Standard Edition, you'll encounter a "scale-out deployment is not supported in this edition of reporting services" error when you open the SSRS Web Portal.

We just need to delete the source server record.

SELECT * 
FROM [ReportServer].[dbo].[keys]
GO
[ReportServer].[dbo].[keys]
DELETE [dbo].[Keys]
WHERE InstanceName LIKE 'SQL2012'
GO

Open http://targetservername/Reports/ and here are our Reports.

Target SSRS Server Report

And here are the Subscriptions.

Target SSRS Server Report Subscription

And here is the SQL Agent Job that was automatically created.

SQL Agent Job

You'll probably want to disable jobs while testing.

Checklist

Also, here's a handy checklist to use if you like simple checklists like I do.

SSRS Migration Checklist

  • Source Server
    • Backup ReportServer and ReportServerTempDB together
    • Copy backups to target server
    • Backup SSRS Encryption Key
  • Target Server
    • Stop Reporting Services thru Reporting Services Configuration Manager
    • Restore ReportServer and ReportServerTempDB from backups
    • Update Compatibility Level if going to newer version SQL Server
    • Update database owners
    • Run DBCC CHECKDB on ReportServer and ReportServerTempDB
    • Fix logins and users
    • Start Reporting Services
    • Verify no login errors in errorlog
    • Restore Encryption Key
    • DELETE [ReportServer].[dbo].[Keys]  WHERE InstanceName = 'SourceSsrsServerName'
    • Validate at http://TargetServerName/Reports/
    • Test
Next Steps

Following are some links to more info on migrating SQL Server Reporting Services



sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Joe Gavin Joe Gavin is from the Greater Boston area. He started working with SQL Server and Sybase in 1998 in the financial services industry and has been a SQL Server Database Administrator for a dairy cooperative since 2011. He graduated from Northeastern University in Boston with a Bachelor of Science in Engineering Technology (BSET) degree in Computer Technology. Joe has spoken at the Boston and Providence SQL Saturday events.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips



Comments For This Article




Friday, February 16, 2024 - 2:21:21 PM - Joe Gavin Back To Top (91982)
Kanav, any time I've migrated an SSRS instance I've migrated the SQL Agent jobs separately beforehand as a regular migration step. They do have to be done separately as they're in msdb and not the SSRS databases.

Thanks for pointing it out.

Friday, February 16, 2024 - 7:44:00 AM - Kanav Chawla Back To Top (91975)
Hi Joe, This tip is very helpful, I've successfully migrated my report server database from SQL 2016 to SQL 2022. Almost everything went well. Reports, Data sources, Subscriptions got moved gracefully. However there is just one problem which is quite big i.e. the SQL agent jobs for the subscriptions are not getting created. Any thoughts ?

Thursday, October 12, 2023 - 3:06:54 PM - Joe Gavin Back To Top (91658)
Beatriz, sounds like you may have a problem with the encryption key. May want to export / import it again.

Wednesday, October 11, 2023 - 12:02:16 PM - Beatriz Back To Top (91650)
I carried out all the steps and it works fine but I have a problem, the groups and users that I had in the security section are not migrated, nor are the access permissions in the reports based on the roles. your help please

Tuesday, October 3, 2023 - 9:04:19 PM - Victor Back To Top (91624)
Thanks for this! It worked successfully for migrating a reporting services database from SQL 2012 to SQL 2022! :)

Wednesday, July 19, 2023 - 4:48:42 PM - Joe Gavin Back To Top (91409)
Thanks for the feedback Shaun. I haven't had the need to move one to 2022 yet. Glad to know the solution is still good.

Wednesday, July 19, 2023 - 12:52:46 PM - Shaun Back To Top (91408)
Thanks for this! This worked perfectly for migrating a reporting services database from SQL 2016 to SQL 2022!

Tuesday, June 13, 2023 - 6:44:23 AM - Joe Gavin Back To Top (91278)
Thank you KB!

Friday, June 9, 2023 - 2:44:32 PM - JB Back To Top (91271)
Thanks for this guide -- I've tried rs.exe for a migration and upgrade from SSRS 2012 to 2019 and had nothing but permissions and other errors. This method worked right away. The user accounts and Keys table issues would have stumped me without this article anticipating the problem and solution! Thanks again.

Wednesday, August 17, 2022 - 12:46:52 PM - Khalique Back To Top (90386)
Thanks Joe, I will try the same.

Wednesday, August 17, 2022 - 11:35:52 AM - Joe Gavin Back To Top (90385)
Khalique, good question. I've never gone all the way from 2008R2 to 2019 but the most recent one I've done going from 2017 to 2019 started off originally on 2008R2 but had stops at 2012 and 2017. I'd say 2012 as an interim step would be a good idea.

Wednesday, August 17, 2022 - 10:27:22 AM - Khalique Back To Top (90384)
Hi Joe,
I want to refer back to your comment on May 17, 2022. I used this process to upgrade 2008R2 to 2019. I succeeded but have some issues. For example, reports are missing data sources. And Subscriptions not working and not even editable.
My question is should I move 2008R2 to an intermediate version, like 2012, before going to 2019? What do you suggest?
Thanks.

Wednesday, May 18, 2022 - 3:31:00 PM - TomV Back To Top (90099)
So it appears the upgrade process for the ReportServer and ReportServerTemp databases is performed by the SSRS Service upon startup.
Just compared a set of 2017 database to the restored copy of those same databases on a new 2019 SSRS instance after following your procedure and there are 30 new and 23 updated objects and 1 that doesn't exist in the ReportServer database on the 2019 instance.

Tuesday, May 17, 2022 - 2:06:05 PM - Joe Gavin Back To Top (90098)
TomV, I've used this process going from 2008R2 to 2012 to 2017 and 2019 without any problem.

Tuesday, May 17, 2022 - 12:58:17 PM - TomV Back To Top (90097)
Where's the upgrade step? You can't tell me a 2012 SSRS database is compatible with 2017. Does the service automatically upgrade the DB when the service starts? What am I missing?

Thursday, May 27, 2021 - 1:14:49 AM - MOHAN BABU SUKUMAR Back To Top (88750)
I exactly followed the steps and it worked. Thanks a lot for your effort.

Thursday, February 11, 2021 - 6:20:17 AM - Vivek Siddhapura Back To Top (88219)
Thanks for the prompt response, this problem solved which comes because i was not update encryption key.
after came other error 'System.Guid' to type 'System.String'. whenever i report open from source side.
which are not shown web portal side.

Wednesday, February 10, 2021 - 10:49:25 AM - Joe Gavin Back To Top (88210)
Vivek, are you sure you deleted the old SSRS instance name?

Wednesday, February 10, 2021 - 5:27:13 AM - Vivek Siddhapura Back To Top (88204)
I followed your step but last show
"The feature: "Scale-out deployment" is not supported in this edition of Reporting Services. (rsOperationNotSupported) "
and [ReportServer].[dbo].[Keys] delete old key but when start report server service again restore in table

Tuesday, February 25, 2020 - 5:15:54 PM - Mustafa ELmasry Back To Top (84797)

It is good solution in case we are moving one server to new server but let us assume that we have multiple reporting services and we need to consolidate all of them in one server using one DB report server and report server temp at this time this solution will not be applicable and I think we should move the reports RDL only from the multiple servers to the new server using tool like RSScripter.

but based on my experience this tool migrating only the reports and the data source will be created without the connection information so you should take care about the Data source connection information and the security also you need to move it manual . is there is any other solution to move all the reports information (RDL, Connection string , security , emails ) from multiple reporting servers to one report server?















get free sql tips
agree to terms