HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Migration from SSRS 2012 to SSRS 2017

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
ssrsmigration20122017from

Problem

Our company is moving from SSRS 2012 to SSRS 2017. I would like to know if anyone has done a similar migration. If yes, could you please guide me through the steps?

From what I read about the migration, it looks like its a very tiring process since I will have to download each report from 2012 server and upload it into 2017 server. or use PowerShell scripting to automate the same.

If anyone knows a better way to do it, I am all ears.

Thanks

Solution

Here's the process I use to migrate to a new report server. This is assuming you are not already using source control and you don't have a Visual Studio solution for your reports. If you do, skip to #4. If you have the database permissions, you can use the Microsoft guide Moving the Report Server Databases.
  1. Backup deployed reports



  • Remote to the current report server.



%systemroot%/system32/mstsc.exe

  • Then save the following procedure as a .rss file and run it with the parameter parentFolder="" as a zero string to save the entire folder structure with all the reports.



Command Line:

rs -s http://localhost/reportserver -i D:\Scripts\Backup_Reports.rss -e Mgmt2010 -v backupFolder="D:\Scripts\BackupReports" -v parentFolder=""

Report Backup Procedure:

Public Sub Main()
    '--------------------------------------------------------------------------------------------------------------------
    ' Purpose:   Script to backup reports from a folder on ReportServer
    '            Save file as .rss extension and run using rs.exe from command line.
    ' Reference: http://bhushan.extreme-advice.com/back-up-of-ssrs-reports-using-rs-utility/
    '            https://learn.microsoft.com/en-us/sql/reporting-services/tools/rs-exe-utility-ssrs?view=sql-server-2017
    ' Example:   rs -s http://localhost/reportserver -i D:\Scripts\Backup_Reports.rss -e Mgmt2010 -v backupFolder="D:\Scripts\BackupReports" -v parentFolder="/IndividualReportFolderNameHere"
    '            rs -s http://localhost/reportserver -i D:\Scripts\Backup_Reports.rss -e Mgmt2010 -v backupFolder="D:\Scripts\BackupReports" -v parentFolder=""
    '--------------------------------------------------------------------------------------------------------------------
    Try
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials
        Dim items As CatalogItem() = Nothing

        If String.IsNullOrEmpty(parentFolder) Then
            items = rs.ListChildren("/", True)
        Else
            items = rs.ListChildren(parentFolder, False)
        End If

        Console.WriteLine()
        Console.WriteLine("...Reports Back Up Started...")

        For Each item As CatalogItem In items
            If item.TypeName = "Report" Then
                Console.WriteLine(item.Path)
                Dim reportPath As String = item.Path
                parentFolder = Path.GetDirectoryName(item.Path) ' comment out this line to save the reports in one folder
                Dim reportDefinition As Byte() = rs.GetItemDefinition(item.Path)
                Dim rdlReport As New System.Xml.XmlDocument
                Dim Stream As New MemoryStream(reportDefinition)
                Dim backupPath As String = Path.Combine(backupFolder, Date.Now().ToString("yyyy.MM.dd") + "\" + parentFolder)

                If (Not System.IO.Directory.Exists(backupPath)) Then
                    System.IO.Directory.CreateDirectory(backupPath)
                End If

                rdlReport.Load(Stream)
                rdlReport.Save(Path.Combine(backupPath, item.Name + ".rdl"))

                Console.WriteLine(item.Name + ".rdl")
            End If
        Next

        Console.WriteLine("...Reports Back Up Completed...")
        Console.WriteLine()

    Catch e As Exception
        Console.WriteLine(e.Message)

    End Try

End Sub


  1. Create a Visual Studio solution



  • Make a report project per report folder under one solution.



  • Add the reports from the backup .rdl files



  • Add Shared Data Sources



  • Add Shared Datasets



  1. Use source control with Microsoft Azure DevOps Services



  • It's free for teams of 5 or less



  • You can pick a site name with your organization in the url. e.g. https://yourcompany.visualstudio.com



  • url: https://azure.microsoft.com/en-au/services/devops/



  1. Setup deployment configuration



Setup the target deployment settings for each report project using the Configuration Manager.
Report Project Configuration

Configuration Manager

  1. Build the solution



  • I only use this option for the initial build. After that, you can deploy individual reports by right clicking them and selecting Deploy.

Code Snippets

Public Sub Main()
    '--------------------------------------------------------------------------------------------------------------------
    ' Purpose:   Script to backup reports from a folder on ReportServer
    '            Save file as .rss extension and run using rs.exe from command line.
    ' Reference: http://bhushan.extreme-advice.com/back-up-of-ssrs-reports-using-rs-utility/
    '            https://learn.microsoft.com/en-us/sql/reporting-services/tools/rs-exe-utility-ssrs?view=sql-server-2017
    ' Example:   rs -s http://localhost/reportserver -i D:\Scripts\Backup_Reports.rss -e Mgmt2010 -v backupFolder="D:\Scripts\BackupReports" -v parentFolder="/IndividualReportFolderNameHere"
    '            rs -s http://localhost/reportserver -i D:\Scripts\Backup_Reports.rss -e Mgmt2010 -v backupFolder="D:\Scripts\BackupReports" -v parentFolder=""
    '--------------------------------------------------------------------------------------------------------------------
    Try
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials
        Dim items As CatalogItem() = Nothing

        If String.IsNullOrEmpty(parentFolder) Then
            items = rs.ListChildren("/", True)
        Else
            items = rs.ListChildren(parentFolder, False)
        End If

        Console.WriteLine()
        Console.WriteLine("...Reports Back Up Started...")

        For Each item As CatalogItem In items
            If item.TypeName = "Report" Then
                Console.WriteLine(item.Path)
                Dim reportPath As String = item.Path
                parentFolder = Path.GetDirectoryName(item.Path) ' comment out this line to save the reports in one folder
                Dim reportDefinition As Byte() = rs.GetItemDefinition(item.Path)
                Dim rdlReport As New System.Xml.XmlDocument
                Dim Stream As New MemoryStream(reportDefinition)
                Dim backupPath As String = Path.Combine(backupFolder, Date.Now().ToString("yyyy.MM.dd") + "\" + parentFolder)

                If (Not System.IO.Directory.Exists(backupPath)) Then
                    System.IO.Directory.CreateDirectory(backupPath)
                End If

                rdlReport.Load(Stream)
                rdlReport.Save(Path.Combine(backupPath, item.Name + ".rdl"))

                Console.WriteLine(item.Name + ".rdl")
            End If
        Next

        Console.WriteLine("...Reports Back Up Completed...")
        Console.WriteLine()

    Catch e As Exception
        Console.WriteLine(e.Message)

    End Try

End Sub

Context

StackExchange Database Administrators Q#220206, answer score: 3

Revisions (0)

No revisions yet.