Documentation forSolarWinds Observability SaaS

Migrate a Network Collector

If you need to decommission a server or meet updated system requirements, you may need to migrate your Network Collector to a new server. Follow the steps in this section to complete the migration.

This guide applies to Network Collector deployments with a local SQL Express database on the same server (the default configuration). If your deployment uses a dedicated SQL Server, the migration steps may differ.

Install Network Collector on a new server

Log on to the server where you want to install the new Network Collector and install a new instance of the Network Collector. See Install the Network Collector.

Install sqlcmd on both servers

Before staring the migration, download and install sqlcmd on both the original and the new Network Collector servers. Sqlcmd is used for backing up the existing database and restoring it on the new Network Collector server.

You can use one of the following PowerShell commands. You can also download sqcmd from the Internet:

winget install sqlcmd

or

choco install sqlcmd

Do a backup of the database of the old Network Collector server

  1. Stop all SolarWinds services using SolarWinds Platform Service Manager by default located in

    "C:\Program Files\SolarWinds\Orion\StopNetPerfMon.exe"
  2. If you have installed sqlcmd, open a new PowerShell window to ensure the reload of environmental variables.

  3. Back up SolarWinds databases on the original Network Collector server. Execute the db-backup.ps1 PowerShell script as Administrator on the original Network Collector machine. This may take a few minutes depending on the database size.

    db-backup.ps1

    <#
    .SYNOPSIS
      Back up SolarWinds databases on a SQL Express instance, using single-user mode to elevate.
    
    .DESCRIPTION
      1. Puts the SQL Express instance into single-user mode so local Admin is sysadmin
      2. Stops UAMS, runs full backups of the three Orion DBs via sqlcmd
      3. Logs output to specified folder
      4. Exits single-user mode (restores multi-user)
      5. Disables UAMS client
    
    .PARAMETER BackupFolder
      Folder to write the .bak files and the log. Defaults to 'C:\'.
    
    .PARAMETER InstanceName
      Named SQL Express instance (after the $ in MSSQL$InstanceName). Defaults to 'SOLARWINDS_ORION'.
    
    .NOTES
      Run as Administrator:
        Set-ExecutionPolicy -Scope Process Bypass
        .\db-backup.ps1 -BackupFolder 'C:\MyBackups'
    #>
    
    param(
        [string]$BackupFolder   = 'C:\NetworkCollectorDbBackup'
    )
    
    # Ensure folder path ends with a backslash
    if (-not $BackupFolder.EndsWith('\')) { $BackupFolder += '\' }
    
    # Create backup folder if it doesn't exist
    if (-not (Test-Path -Path $BackupFolder)) {
        Write-Host "`n=== Creating backup folder: $BackupFolder ==="
        New-Item -Path $BackupFolder -ItemType Directory -Force | Out-Null
    }
    
    # Registry path for SQL service
    $serviceName = 'MSSQL$SOLARWINDS_ORION'
    $sqlServer   = '.\SOLARWINDS_ORION'
    $logFile     = "${BackupFolder}db-backup.log"
    $backupLog   = "${BackupFolder}db-backup.log"
    $flowBak     = "${BackupFolder}SolarWindsFlowStorage.bak"
    $orionBak    = "${BackupFolder}SolarWindsOrion.bak"
    $orionLogBak = "${BackupFolder}SolarWindsOrionLog.bak"
    
    function Exit-OnError { param($code, $msg) if ($code -ne 0) { Write-Error $msg; exit $code } }
    
    Write-Host "`n=== Backup folder: $BackupFolder ==="
    
    # Stop SQL Express instance if running
    Write-Host "`n=== Stopping $serviceName if running ==="
    Stop-Service -Name $serviceName -Force -ErrorAction SilentlyContinue
    
    # Start in single-user mode via net start /m"SQLCMD"
    Write-Host "`n=== Starting $serviceName in SINGLE-USER mode ==="
    & net start $serviceName "/m" | Write-Host
    Start-Sleep -Seconds 10
    
    # Stop UAMS
    Write-Host "`n=== Stopping SolarWinds UAMS Client ==="
    Stop-Service swiuamsclientd -ErrorAction SilentlyContinue
    
    # Build and run backup SQL
    $backupSql = @"
    BACKUP DATABASE [SolarWindsFlowStorage]
      TO DISK = N'$flowBak' WITH FORMAT, MEDIANAME = 'SQLServerBackups', NAME = 'Full Backup of SolarWindsFlowStorage';
    BACKUP DATABASE [SolarWindsOrion]
      TO DISK = N'$orionBak' WITH FORMAT, MEDIANAME = 'SQLServerBackups', NAME = 'Full Backup of SolarWindsOrion';
    BACKUP DATABASE [SolarWindsOrionLog]
      TO DISK = N'$orionLogBak' WITH FORMAT, MEDIANAME = 'SQLServerBackups', NAME = 'Full Backup of SolarWindsOrionLog';
    "@
    
    Write-Host "`n=== Running BACKUP via sqlcmd ==="
    & sqlcmd -S $sqlServer -Q $backupSql 2>&1 | Tee-Object -FilePath $logFile
    Exit-OnError $LASTEXITCODE "Backup failed. Check $logFile for details."
    
    Write-Host "`n=== Restarting $serviceName in MULTI-USER mode ==="
    Restart-Service -Name $serviceName -Force -ErrorAction Stop
    Start-Sleep -Seconds 5
    
    # 5) Disable & stop UAMS client
    Write-Host "`n=== Disabling & stopping UAMS Client ==="
    Set-Service -Name swiuamsclientd -StartupType Disabled
    Stop-Service -Name swiuamsclientd -ErrorAction SilentlyContinue
    
    # Summary
    Write-Host "`n=== Backup Log Summary ==="
    Select-String -Path $backupLog -Pattern 'BACKUP DATABASE' | ForEach-Object { $_.Line }
    Write-Host "`n=== Backup complete. Files in $BackupFolder ==="
    Read-Host "Press Enter to exit"
  4. Transfer all three database backup files to the new Network Collector server. By default, the files are located in C:\NetworkCollectorDbBackup\.

Task 4: Do a restore of the database on the new Network Collector server

On the new Network Collector server, complete the following steps.

  1. Stop all SolarWinds Platform services using SolarWinds Platform Service Manager.

  2. If you have installed sqlcmd, open a new PowerShell window to reload environmental variables.

  3. Restore the SolarWinds databases from backup files into the SQL Express instance used by the new Network Collector. Run the db-restore.ps1 PowerShell script as Administrator. Run the script with the argument -BackupFolder "PathToTheDirectoryWithDatabaseSnashots".

    .\db-restore.ps1 -BackupFolder "PathToTheDirectoryWithDatabaseSnapshts.

    db-restore.ps1

    param (
        [string]$BackupFolder = "C:\"
    )
    
    # Configuration
    $serviceName = 'MSSQL$SOLARWINDS_ORION'
    $sqlServer = ".\SOLARWINDS_ORION"
    $username = "Builtin\Administrators"
    $logFile = Join-Path $BackupFolder "db-restore.log"
    
    # Stop UAMS client
    Write-Host "`n=== Stopping UAMS Client ==="
    Stop-Service -Name swiuamsclientd -ErrorAction SilentlyContinue
    
    # Stop SQL Express instance if running
    Write-Host "`n=== Stopping $serviceName if running ==="
    Stop-Service -Name $serviceName -Force -ErrorAction SilentlyContinue
    
    # Start in single-user mode via net start /m"SQLCMD"
    Write-Host "`n=== Starting $serviceName in SINGLE-USER mode ==="
    & net start $serviceName "/m" | Write-Host
    Start-Sleep -Seconds 10
    
    # Grant sysadmin to Builtin\Administrators
    Write-Host "`n=== Granting sysadmin to $username ==="
    $sql = "CREATE LOGIN [$username] FROM WINDOWS; ALTER SERVER ROLE [sysadmin] ADD MEMBER [$username];"
    sqlcmd -S $sqlServer -Q $sql
    
    Write-Host "`n=== Restarting $serviceName in MULTI-USER mode ==="
    Restart-Service -Name $serviceName -Force -ErrorAction Stop
    Start-Sleep -Seconds 5
    
    # Build restore SQL
    $restoreSql = @"
    USE [master];
    ALTER DATABASE [SolarWindsFlowStorage] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    RESTORE DATABASE [SolarWindsFlowStorage] FROM DISK = N'$BackupFolder\SolarWindsFlowStorage.bak' WITH REPLACE;
    ALTER DATABASE [SolarWindsFlowStorage] SET MULTI_USER;
    USE [SolarWindsFlowStorage];
    ALTER USER SolarWindsOrionDatabaseUser WITH LOGIN = SolarWindsOrionDatabaseUser;
    
    USE [master];
    ALTER DATABASE [SolarWindsOrionLog] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    RESTORE DATABASE [SolarWindsOrionLog] FROM DISK = N'$BackupFolder\SolarWindsOrionLog.bak' WITH REPLACE;
    ALTER DATABASE [SolarWindsOrionLog] SET MULTI_USER;
    USE [SolarWindsOrionLog];
    ALTER USER SolarWindsOrionDatabaseUser WITH LOGIN = SolarWindsOrionDatabaseUser;
    
    USE [master];
    ALTER DATABASE [SolarWindsOrion] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    RESTORE DATABASE [SolarWindsOrion] FROM DISK = N'$BackupFolder\SolarWindsOrion.bak' WITH REPLACE;
    ALTER DATABASE [SolarWindsOrion] SET MULTI_USER;
    USE [SolarWindsOrion];
    ALTER USER SolarWindsOrionDatabaseUser WITH LOGIN = SolarWindsOrionDatabaseUser;
    
    UPDATE Engines SET ServerName = HOST_NAME();
    UPDATE Websites SET ServerName = HOST_NAME();
    UPDATE OrionServers SET HostName = HOST_NAME();
    
    TRUNCATE TABLE HA_FacilitiesInstances;
    TRUNCATE TABLE HA_PoolMemberInterfacesInfo;
    TRUNCATE TABLE HA_PoolMembers;
    TRUNCATE TABLE HA_Pools;
    TRUNCATE TABLE HA_ResourcesInstances;
    "@
    
    # Run restore and log output
    Write-Host "`n=== Running restore and cleanup SQL ==="
    sqlcmd -S $sqlServer -E -Q $restoreSql | Tee-Object -FilePath $logFile -Append
    # Show restore lines
    Write-Host "`n=== Restore complete. Tail of RESTORE lines from log: ==="
    Select-String -Path $logFile -Pattern "RESTORE DATABASE" | ForEach-Object { $_.Line }
    
    # Restart UAMS client
    Write-Host "`n=== Restarting UAMS Client ==="
    Start-Service -Name swiuamsclientd -ErrorAction SilentlyContinue
    Read-Host "Press Enter to exit"
    
  4. When the script completes, run the Configuration wizard, by default located in "C:\Program Files\SolarWinds\Orion\ConfigurationWizard.exe". Do not change any settings, confirm the warning about server migration and wait for the wizard to complete.

  5. Stop the Orion Module Engine service using SolarWinds Platform Service Manager.

  6. Manually deactivate the license. Run the Migration tool on the new Network Collector server. By default, the migration tool is located in "C:\Program Files\SolarWinds\Orion\Migration.exe".

    .\Migration.exe /expireAll
  7. Start the Orion Module Engine service using the SolarWinds Platform Service Manager

The migration is finished. The new license will be automatically obtained from SolarWinds Observability SaaS.

After migration tasks

  1. [Optional] Edit existing scheduled discoveries in SolarWinds Observability SaaS

    1. In SolarWinds Observability, go to Settings > Network Discoveries

    2. Look for discoveries executed on the original Network Collectorr server.

    3. Click Edit and change the Discovery configuration to the new Network Collector server.

    4. Complete the Discovery wizard and save your changes.

  2. [Optional] If you had nodes polled by the Agent on the original Network Collector , redeploy or reconnect the active SolarWinds Platform Agents (agent-initiated polling). You can:

    • Redeploy agents through a SolarWinds Platform server push (recommended)

    • Manually change the Network Collector server IP address the agent uses via the Windows Control Panel. This option is suitable for if you only have a few agents.

    • Use the Group Policy Administrative template to redirect existing agents to the new Network Collector server.

  3. [Optional] Configure NetFlow on Network Devices. You may need to configure the network devices themselves to send flow data to the new Network Collector. For example, for Cisco routers, you might use some of the following commands:

    ip flow-export version 9
    ip flow-export destination <New Network Collector IP> 2055
    ip flow-export source <interface>
  4. Shut down the original Network Collector server. You can decommission it now.