![]() |
果断的面包
1 年前 |
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge More info about Internet Explorer and Microsoft Edge SharePoint
This article includes and describes a sample Reporting Services RSS script that copies content items and settings from one SQL Server Reporting Services report server to another report server, using the RS.exe utility. RS.exe is installed with Reporting Services, both native and SharePoint mode. The script copies Reporting Services items, for example reports and subscriptions, from server to another server. The script supports both SharePoint mode and Native mode report servers.
The open-source ReportingServicesTools PowerShell module is also available.
Download the script from the GitHub site Reporting Services RS.exe migration script to a local folder. For more information, see the section How to use the script in this article.
The script supports both SharePoint mode and Native mode report servers. The script supports the report server versions SQL Server 2008 R2 (10.50.x) and later, and Power BI Report Server.
The script can be used to copy content between report servers of the same mode or different modes. For example, you can run the script to copy content from a SQL Server 2008 R2 (10.50.x) native mode report server to a SQL Server 2012 SP1 (11.0.3x) SharePoint mode report server. You can run the script from any server where RS.exe is installed. For example, in the following deployment, you can:
Run RS.exe and the script ON Server A.
To copy content FROM Server B
TO Server C
For more information on the RS.exe utility, see RS.exe Utility (SSRS) .
The script won't write over existing content items of the same name. If the script detects items with the same name on the destination server that are on the source server, the individual items will result in a "failure" message and the script will continue. The following table lists the types of content and resources the script can migrate to target report server modes.
Migrated SharePoint Description Passwords are NOT migrated. After content items are migrated, update the credential information on the destination server. For example, data sources with stored credentials. My Reports The Native mode "My Reports" feature is based on individual user sign-ins therefore the scripting service doesn't have access to content in "My Reports" folders for users other than the -u parameter used to run the rss script. Also, "My Reports" isn't a feature of Reporting Services SharePoint mode and items in the folders can't be copied to a SharePoint environment. Therefore, the script doesn't copy report items that are in the "My Reports" folders on a source native mode report server
Migrating schedules: 1 items found. Migrating schedule: theMondaySchedule ... FAILURE: The SQL Agent service isn't running. This operation requires the SQL Agent service. ---> Microsoft.ReportingServices.Diagnostics.Utilities.SchedulerNotResponding Exception: The SQL Agent service isn't running. This operation requires the SQL Agent service.
Roles and system policies
By default the script won't copy custom permission schema between servers. The default behavior is the items will be copied to the destination server with the 'inherit parent permissions' flag set to TRUE. If you want the script to copy permissions for individual items, use the SECURITY switch.
Migrating role: Browser ... FAILURE: The role 'Browser' already exists and cannot be created. ---> Microsoft.ReportingServices.Diagnostics.Utilities.RoleAlreadyExistsException: The role 'Browser' already exists and cannot be created.
Migrating DataSource: /Data Sources/Aworks2012_oltp ... FAILURE:The item '/Data Sources/Aworks2012_oltp' already exists. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ItemAlreadyExistsException: The item '/Data Source s/Aworks2012_oltp' already exists.
Migrating Folder: /Reports ... FAILURE: The item '/Reports' already exists. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ItemAlreadyExistsException: The item '/Reports' already exists.
Report
The script won't overwrite existing items on the target server. If an item on the target server already exists with the same name, you will see an error message similar to this one:
Migrating Report: /Reports/testThe item '/Reports/test' already exists. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ItemAlreadyExistsException: The item '/Reports/test' already exists.
Power BI Reports
Only available with Power BI Report Server
Report parts are deprecated for all releases of SQL Server Reporting Services starting with SQL Server Reporting Services 2019 and all releases of Power BI Report Server starting with Power BI Report Server September 2022.
SQL Server Mobile Report Publisher is deprecated for all releases of SQL Server Reporting Services after SQL Server Reporting Services 2019. It is discontinued starting in SQL Server Reporting Services 2022 and Power BI Report Server.
The permissions required to read or write items and resources isn't the same for all of the methods used in the script. The following table summarizes the methods used for each item or resource and links to related content. Navigate to the individual article to see the required permissions. For example, the ListChildren method topic notes the required permissions of:
Native Mode Required Permissions: ReadProperties on Item
SharePoint Mode Required Permissions: ViewListItems
Catalog items ListChildrenFor more information, see Compare Roles and Tasks in Reporting Services to SharePoint Groups and Permissions .
Download the script file to a local folder, for example c:\rss\ssrs_migration.rss .
Open a command prompt with administrative privileges .
Navigate to the folder containing the ssrs_migration.rss file.
Run the command with the parameters appropriate for your scenario.
Basic Example, native mode report server to native mode report server:
The following example migrates content from the native mode Sourceserver to the native mode Targetserver .
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s https://SourceServer/ReportServer -u Domain\User -p password -v ts="https://TargetServer/reportserver" -v tu="Domain\Userser" -v tp="password"
Usage notes:
The script runs in two steps.
The first step is an audit, to return a list of items that will be migrated and the second step is the migration process.
You can cancel the script after step one if you only want to see the possible migration list or you want to modify the parameters. Dependent settings aren't listed in step one. For example, the cache options of a report aren't listed but the report itself is.
If you want to just audit a single server, use the same server for source and destination and cancel after step 1.
A good use of the step 1 audit information is to review existing roles on both the source and target Native mode server. The following is an example of the step one audit list. Notice the list includes a "roles" section because the switch-v security="True" was used:
Retrieve and report the list of items that will be migrated. You can cancel the script after step 1 if you do not want to start the actual migration.
Retrieving roles:
Role: Browser
Role: Content Manager
Role: Model Item Browser
Retrieve and report the list of items that will be migrated. You can cancel the script after step 1 if you do not want to start the actual migration.
Retrieving roles:
Role: Browser
Role: Content Manager
Role: CustomRole
Role: Model Item Browser
Role: My Reports
Role: Publisher
Role: Report Builder
Role: System Administrator
Role: System User
Retrieving system policies:
Retrieving system policies:
System policy: BUILTIN\Administrators
System policy: domain\user1
System policy: domain\ueser2
Retrieving schedules:
Schedule: theMondaySchedule
Retrieving catalog items. This may take a while.
Folder: /Data Sources
DataSource: /Data Sources/Aworks2012_oltp
Folder: /images
Resource: /images/Boba Fett.png
Resource: /images/R2-D2.png
Folder: /Reports
Report: /Reports/products
Report: /Reports/test
Report: /Reports/TitleOnly
The SOURCE_URL and TARGET_URL must be valid report server URLs that point to the source and target Reporting Services report server. In native mode, a report server URL looks like this URL:
https://servername/reportserver
In SharePoint mode, the URL looks like this URL:
https://servername/_vti_bin/reportserver
The virtual folder structure presented to the user in SharePoint might be different than the underlying one. Open
https://servername/_vti_bin/reportserver
or
https://servername/sites/site_name/_vti_bin/reportserver
in a browser to see the non-virtual folder structure. This is helpful for setting source folder and target folder to something other than "/", for a server in SharePoint mode.
Passwords aren't migrated, and must be re-entered, for example data sources with stored credentials.
The following example migrates content from the native mode Sourceserver to the native mode Targetserver .
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s https://SourceServer/ReportServer -u Domain\User -p password -v ts="https://TargetServer/reportserver" -v tu="Domain\Userser" -v tp="password"
The following example adds the security switch:
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s https://SourceServer/ReportServer -u Domain\User -p password -v ts="https://TargetServer/reportserver" -v tu="Domain\Userser" -v tp="password" -v security="True"
Native mode to SharePoint mode - root site
The following example migrates content from a native mode SourceServer to the "root site " on a SharePoint mode server TargetServer. The "Reports" and "Data Sources" folders on the native mode server are migrated as new libraries on the SharePoint deployment.
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s https://SourceServer/ReportServer -u Domain\User -p Password -v ts="https://TargetServer/_vti_bin/ReportServer" -v tu="Domain\User" -v tp="Password"
Native mode to SharePoint mode -'bi' site collection
The following example migrates content from a native mode server to a SharePoint server that contains a site collection of "sites/bi" and a shared documents library. The script creates folders in document the destination library. For example, the script will create a "Reports" and "Data Sources" folders in the target document library.
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s https://SourceServer/ReportServer -u Domain\User -p Password -v ts="https://TargetServer/sites/bi/_vti_bin/reportserver" -v tst="sites/bi" -v tf="Shared Documents" -v tu="Domain\User" -v tp="Password"
SharePoint mode to SharePoint Mode -'bi' site collection
The following example migrates content:
From a SharePoint server SourceServer that contains a site collection of "sites/bi" and a shared documents library.
To a TargetServer SharePoint server that contains a site collection of "sites/bi" and a shared documents library.
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s https://SourceServer/_vti_bin/reportserver -v st="sites/bi" -v f="Shared Documents" -u Domain\User1 -p Password -v ts="https://TargetServer/sites/bi/_vti_bin/reportserver" -v tst="sites/bi" -v tf="Shared Documents" -v tu="Domain\User" -v tp="Password"
Native mode to native mode - Azure virtual machine
The following example migrates content:
From a Native mode report server SourceServer.
To a TargetServer Native mode report server running on an Azure virtual machine. The TargetServer isn't joined to the domain of the SourceServer and the User2 is an administrator on the Azure virtual machine TargetServer.
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s https://SourceServer/ReportServer -u Domain\user1 -p Password -v ts="https://ssrsnativeazure.cloudapp.net/ReportServer" -v tu="user2" -v tp="Password2"
For information on how to use Windows PowerShell to create Reporting Services report servers on Azure virtual machines, see Use PowerShell to Create an Azure VM With a Native Mode Report Server.
SharePoint mode -'bi' site collection to a native mode server on an Azure virtual machine.
The following example migrates content:
From a SharePoint mode report server SourceServer that contains a site collection of "sites/bi" and a shared documents library.
To a TargetServer Native mode report server running on an Azure virtual machine. The TargetServer isn't joined to the domain of the SourceServer and the User2 is an administrator on the Azure virtual machine TargetServer.
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s https://uetesta02/_vti_bin/reportserver -u user1 -p Password -v ts="https://ssrsnativeazure.cloudapp.net/ReportServer" -v tu="user2" -v tp="Passowrd2"
Verification
The section summarizes some of the steps to take on the destination server to verify content and policies were successfully migrated.
Schedules
To verify schedules on the target server:
Native Mode
Open the web portal on the destination server.
Select Site Settings on the top menu.
Select Schedules in the left pane.
SharePoint mode:
Browse to Site settings.
In the Reporting Services group, click Manage Shared Schedules.
Roles and groups
Native Mode
Open SQL Server Management Studio and connect to your native mode report server.
In Object Explorer click Security.
Click Roles.
Troubleshooting
Use the trace flag -t to receive more information. For example, if you run the script and see a message similar to the following
Could not connect to server: https://<servername>/ReportServer/ReportService2010.asmx
Run the script again with the -t flag, to see a message similar to this one:
System.Exception: Could not connect to server: https://<servername>/ReportServer/ReportService2010.asmx ---> System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Microsoft.SqlServer.ReportingServices2010.ReportingService2010.IsSSLRequired() at Microsoft.ReportingServices.ScriptHost.Management2010Endpoint.PingService(String url, String userName, String password, String domain, Int32 timeout) at Microsoft.ReportingServices.ScriptHost.ScriptHost.DetermineServerUrlSecurity() --- End of inner exception stack trace ---
See also
RS.exe Utility (SSRS)
Compare Roles and Tasks in Reporting Services to SharePoint Groups and Permissions