|
<< Click to Display Table of Contents >> RayVentory Scan Engine > 12.5 u5 > RayVentory Scan Engine Migrating from previous versions |
Perform upgrade using standard MSI installation (both Scan Engine and Inventory Agent must be updated separately).
1.Perform upgrade using standard MSI installation (both Scan Engine and Inventory Agent must be updated separately).
2.Stop the RayVentory Scan Engine Scheduler service
a.Make sure to close the app and all its processes.
b.Using any text editor, open the file C:\ProgramData\Raynet\RayVentoryPortal\Config\schedule.xml.
c.Replace all occurrences of <HostAndIpOperatorAnd>true</HostAndIpOperatorAnd> with <HostAndIpOperatorAnd>false</HostAndIpOperatorAnd>
d.Start the RayVentory Scan Engine Scheduler service again
•The user must be an administrator
•Powershell version 3.0 or newer must be installed (information about the current version is contained within the $PSVersionTable variable)
1.Install RayVentory Scan Engine Scan Engine 12.5 u5
2.Copy the migration script (see below) to a location where it can be started from a local system.
3.Open Windows PowerShell or Windows Terminal as administrator
4.Navigate to the folder where a local copy of migration script exists.
oIn case the execution of PowerShell scripts is restricted on the current system, execute additionally the following command to allow it temporarily:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
oIn case the script is blocked by your system, unblock it with the following command:
Unblock-File -Path .\MigrateRVPtoRVSE.ps1
5.Execute the script
.\MigrateRVPtoRVSE.ps1
6.[Optional] Check if hard-coded values in configuration nodes of config.xml file are set to relative paths:
oOracleTrackerFolderPath
oNdtrackExecutablePath
oRIWClassesFile
The following migration script is also available online:
https://raynetgmbh.zendesk.com/hc/en-us/articles/360045755511-RVY200601-Migrating-RayVentory-Portal-to-RayVentory-Scan-Engine-12-0-
<#
@Title = A script to migrate from RayVentory Portal to RayVentory Scan Engine
@Author = Raynet GmbH
@Version = 0.1
@Description = This script is supposed to adjust Config.xml files to fix obsolete hardcoded paths
#>
# Setting up logging
Write-Host "Starting migration script"
$tempFilePath = [System.IO.Path]::Combine($env:TEMP, "RVPtoRVSEmigration.log")
Start-Transcript -Path $tempFilePath -NoClobber -Append
Write-Host "PowerShell information"
$PSVersionTable
Write-Host ""
try {
# Extraction of RVP appdata storage from Registry
$appdataPath = [string]::Empty;
$programFilesPath = [string]::Empty;
if ([Environment]::Is64BitProcess) {
$appdataPath = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Raynet\RayVentoryPortal" -Name "AppDataPath" | Select-Object -ExpandProperty "AppDataPath"
$programFilesPath = [Environment]::ExpandEnvironmentVariables("%ProgramFiles(x86)%")
}
else {
$appdataPath = Get-ItemProperty -Path "HKLM:\SOFTWARE\Raynet\RayVentoryPortal" -Name "AppDataPath" | Select-Object -ExpandProperty "AppDataPath"
$programFilesPath = [Environment]::ExpandEnvironmentVariables("%ProgramFiles%")
}
# Checking if configuration values are in place
if ([string]::IsNullOrEmpty($appdataPath)) {
Write-Warning -Message "RayVentory Portal configuration registry is missing. No migration will be done."
[System.Environment]::Exit(1)
}
$configFilePath = [System.IO.Path]::Combine($appdataPath, "Raynet", "RayVentoryPortal", "Config", "Config.xml");
if (!(Test-Path($configFilePath))) {
Write-Warning -Message "Configuration file not found. No migration will be done."
[System.Environment]::Exit(1)
}
else {
# Updating hardcoded paths
Write-Host "Updating hardcoded paths"
[xml]$configContent = Get-Content -Path $configFilePath -Encoding UTF8
$oratrackPath = $configContent.Configuration.OracleTrackerFolderPath;
$ndtrackPath = $configContent.Configuration.NdtrackExecutablePath;
$isRiwClassesEmpty = $false;
$riwClassesPath = $configContent.Configuration.RIWClassesFile;
if ([string]::IsNullOrEmpty($riwClassesPath)) {
$isRiwClassesEmpty = $true;
}
$isContentChanged = $false
if (!(Test-Path $oratrackPath) -and !($oratrackPath -eq ".\Contrib\Oratrack")) {
Write-Warning "OraTrack configuration is invalid : $oratrackPath. Will be reset to default: .\Contrib\Oratrack"
$oratrackPath = ".\Contrib\Oratrack";
$configContent.Configuration.OracleTrackerFolderPath = $oratrackPath;
$isContentChanged = $true;
}
if (!(Test-Path $ndtrackPath) -and !($ndtrackPath -eq ".\Contrib\ndtrack\ndtrack.exe")) {
Write-Warning "NdTrack configuration is invalid : $ndtrackPath. Will be reset to default: .\Contrib\ndtrack\ndtrack.exe"
$ndtrackPath = ".\Contrib\ndtrack\ndtrack.exe";
$configContent.Configuration.NdtrackExecutablePath = $ndtrackPath;
$isContentChanged = $true;
}
if (!$isRiwClassesEmpty -and !(Test-Path $riwClassesPath) -and !($riwClassesPath -eq ".\example.xml")) {
$riwFileName = [System.IO.Path]::GetFileName($riwClassesPath);
if ([string]::Equals($riwFileName, "example.xml")) {
Write-Warning "Zero-Touch custom inventory configuration file path is invalid: $riwClassesPath. It will be reset to default: .\example.xml"
$riwClassesPath = ".\example.xml";
$configContent.Configuration.RIWClassesFile = $riwClassesPath;
$isContentChanged = $true;
}
else {
Write-Warning "Zero-Touch custom inventory configuration file path is invalid. Please manually adjust the configuration."
}
}
if ($isContentChanged) {
# Making a backup of configuration file
$configBackupPath = $configFilePath + ".old";
$nameNum = 1;
$fullConfigBackupPath = $configBackupPath
while (Test-Path $fullConfigBackupPath) {
$fullConfigBackupPath = $configBackupPath + $nameNum;
$nameNum += 1;
}
Write-Host "Making a backup of Config.xml: $fullConfigBackupPath"
Copy-Item -Path $configFilePath -Destination $fullConfigBackupPath
Write-Host "Writing changes back to Config.xml: $configFilePath";
Remove-Item -Path $configFilePath -Force
$configContent.Save($configFilePath)
Write-Host "Migration process was performed successfully"
}
else {
Write-Host "No changes made to a configuration. Nothing will be written."
}
}
}
catch {
Write-Warning "Migration failed. Check the log file."
Write-Warning $_
}
finally {
Stop-Transcript
}