copy or duplicate a folder in SSRS web portal

  • Is there a way to copy a folder in SSRS 2019 server web portal to another folder, I want to make a copy of backup for temporary keep.

    For example I have  a folder called myReports which has 20 reports in it, I want to duplicate the folder and all the reports in it to another folder called myReports_backup.

    Thanks

  • As far as I know, there is no way to do that. The best solution I know of is to make a new folder and push the files over manually 1 by 1 OR push them through visual studio OR powershell can handle it. NOTE - pushing with Visual Studio is not something I recommend on a production server just in case something was misconfigured, you don't want to have things blow up on you. If I can find the powershell script, I can link it over to you. It is 2 scripts - one to download stuff from SSRS and one to upload stuff to SSRS. I did NOT make the scripts, I just tweaked them for my environment. BUT before going that route, I think there are better solutions than copying a folder and the reports, so I'd like to advocate for those before providing the script...

    I think a better solution to "backup" some reports is to implement a VCS (version control system). Get a tool like GitLab and set up a server to do version control on your reports. That way if you need an older version, just jump back to an earlier commit. If you are removing the reports from SSRS, you still have a backup in git. If someone deletes a report by accident, you have a backup in git. If your SSRS server corrupts itself (key get corrupted for example which means that all reports are going to be irrecoverable if you don't have a backup of the key), you can rebuild from git.

    Our SSRS server has live reports only and our git repo has all the history of the reports. If we don't need a report anymore, it either gets removed from git if we are confident we no longer need it (report relies on a system that has been retired) OR we put it into an "archive" folder in git in the event we MAY need it again in the future OR if we did a cool trick that we may want in other reports. But we never keep "backups" of reports on the report server. There is also risk with keeping backups on the live SSRS server - if you search for the report by name, you get 2 results. What if end users use the wrong one?

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Hi Thank you, Brian.

    We do have version control for reports.

    This backup is on our test server, the project is to convert projects from our existing build software to free version of team city. The report is deployed from team city. And we want to make a copy of backup temporarily to compare in case the new deployment to report server is not working, once new deployment working we will delete the backup folder on report server.

    • This reply was modified 10 months, 2 weeks ago by  sqlfriend.
  • The best way I know how to do it then is to do an export to disk and then import it back in a new folder.

    Here is the export script:

    import-module ReportingServicesTools
    $rsUri = 'https://ReportServerURL'
    $proxy = New-RsWebServiceProxy -ReportServerUri $rsUri
    $rsFolder = '/'
    $destination = 'C:/SSRS'
    Out-RsFolderContent -proxy $proxy -RSFolder $rsFolder -Destination $destination -Recurse

    You will need to update some variables such as $rsUri and $rsFolder, but this is the basic idea for the export. You will need to install the Reporting Services Tools powershell objects if they are not already installed.

    To import:

    import-module ReportingServicesTools
    $rsUri = 'https://ReportServerURL'
    $proxy = New-RsWebServiceProxy -ReportServerUri $sourceRsUri
    $rsFolder = '/'
    $source = 'C:/SSRS'
    Write-RsFolderContent -ReportServerUri $rsUri -Path $source -RsFolder $rsFolder -Recurse

    You will want to update the $rsFolder variable here to the temp folder you want created and the $rsURI variable to your server. Offhand, I do not remember what happens if you try to import and the report already exists, but I believe it is overwrite without asking.

    With the $rsUri variable, this should be pointing to the "reportserver" URI. For example - https://TestSSRS.fake.com/reportserver

    That is the only way I am aware of to do a copy-paste. BUT I would be cautious with the above stuff as I am just some random guy on the internet telling you to run scripts. It really depends on how much you trust me, but the first one will export and the second one will import.

    If possible, I strongly encourage you to run the scripts on a test system that is OK in the event that these scripts do break the system and validate that what I say is correct. If you can clone the VM with SSRS for a quick test of the scripts, that is what I'd do first so you know that the scripts work and know the timing. The export is a slow operation on my system (took about an hour to export everything for me), but it worked how I expected.

    Assumptions I am making are that you are running the EXPORT and IMPORT from a Windows machine and have powershell installed and have access to all of the reports you are trying to export and that you are using passthru authentication. Lot of assumptions, but from my understanding it is a common setup.

    NOTE - with the above scripts you WILL lose some stuff such as subscriptions. This ONLY exports the files, not any additional configuration or settings. If any additional configuration is set up on the files (shared data sets for example), those steps will have to be done manually after the import.

     

    EDIT - fixed formatting of second script. Both should be powershell, but I accidentally set the second one to SQL.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Thanks so much, I will give it a try.

    May come up with more questions

  • Feel free to ask. In my experience, I haven't needed to use the import functionality before. I've exported when I needed a data dump of all my reports to disk when we ran into a case of lost trust in our version control system. Some users forgot to commit and merge their changes and just threw stuff out to live and we got to a point where git and production were out of sync. So we did a dump of production to disk and pushed that up to git (with some tweaks to make it work in visual studio). Not a fun project but thankfully we have only had to do that once since I've been here.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Thank you!

  • This was removed by the editor as SPAM

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply