Is there a way to export all reports into XML? it seems I can only export one report at a time under Manage Reports. We are building out a new fresh Solarwinds environment and would like to export the reports.
bharris I "borrowed" KMSigma's PowerShell script which exports the device templates, and converted it to export the reports. I take absolutely 0% of the credit, as KMSigma had previously done all of the work. I simply had to swap out the query, and that's about it.
Export Non-Default Device Templates
Using PowerShell, you should be able to export all of your reports, in separate XML files, to the directory of your choosing.
Import-Module SwisPowerShell$swis = Connect-Swis -Hostname meow -UserName arf -Password moo# Path where we will export our reports $exportPath = "c:\reports"# Verify export path exists, and create a new folder if it does not.if ( -not ( Test-Path -Path $exportPath -ErrorAction SilentlyContinue ) ){ Write-Warning -Message "Creating new folder: $exportPath" New-Item -Path $exportPath -ItemType Directory | Out-Null}# SWQL query to get all reports.# Use the where clause to adjust reports returned$reports = Get-SwisData $swis "SELECT Name,Title,SubTitle,Category,Type,Description,Owner,Definition FROM Orion.Report"# Loop through reports, exporting each to its own xml file.# Each file exported/created uses the "Name" column from the query above.foreach ($r in $reports){ $filename = "$($r.Name).xml" $r.Definition | Out-File -FilePath (Join-Path -Path $exportPath -ChildPath $filename) -Encoding ascii -Force -Confirm:$false}
The only real issue I found is naming the exported files which contain "illegal" chars, such as the "90/95/99th Percentile..." reports. Otherwise, I was able to run this script, then import the reports back into the system without any issues. The exported reports appeared to function/display properly once imported back into the system, and ran.
I hope this works to get you where you need to go.
Thank you,
-Will
Hi bharris, you are right I don't think this feature exists, its similar to the one mentioned below, once you check multiple reports these options are disabled automatically
XML no but it depends what you want this for. You can output all the reports with their definition using SWQL:
SELECT ReportID, Name, Category, Title, Type, SubTitle, Description, LegacyPath, Definition, ModuleTitle, RecipientList, LimitationCategory, Owner, LastRenderDuration
FROM Orion.Report
FYI: I just took an example report and compared an exported xml of it against the definition field in the database and they are near identical, including the tabbed formatting so presumably you could create a report using the following SWQL, save it as CSV then use powershell or whatever you prefer to export each row into seperate xmls :
SELECT Definition
First 10 lines from the database:
<Report xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SolarWinds.Reporting.Models">
<Category>S</Category>
<Configs xmlns:d2p1="http://schemas.datacontract.org/2004/07/SolarWinds.Reporting.Models.Data">
<d2p1:ConfigurationData xmlns:d3p1="http://schemas.datacontract.org/2004/07/SolarWinds.Reporting.Models.Tables" i:type="d3p1:TableConfiguration">
<d2p1:DisplaySubTitle></d2p1:DisplaySubTitle>
<d2p1:DisplayTitle>Windows Server 2003</d2p1:DisplayTitle>
<d2p1:RefId>f37c8597-acec-40d7-ba5a-cca489590d1f</d2p1:RefId>
<d3p1:Columns>
<d3p1:TableColumn>
<d3p1:CellStyle xmlns:d6p1="http://schemas.datacontract.org/2004/07/SolarWinds.Reporting.Models.Styles">
First 11 lines from the exported xml:
<?xml version="1.0"?>
<Configs xmlns:a="http://schemas.datacontract.org/2004/07/SolarWinds.Reporting.Models.Data">
<a:ConfigurationData xmlns:b="http://schemas.datacontract.org/2004/07/SolarWinds.Reporting.Models.Tables" i:type="b:TableConfiguration">
<a:DisplaySubTitle/>
<a:DisplayTitle>Windows Server 2003</a:DisplayTitle>
<a:RefId>f37c8597-acec-40d7-ba5a-cca489590d1f</a:RefId>
<b:Columns>
<b:TableColumn>
<b:CellStyle xmlns:c="http://schemas.datacontract.org/2004/07/SolarWinds.Reporting.Models.Styles">