Migrate-MdbToAF Usage Guide
- Last UpdatedMay 14, 2026
- 1 minute read
- PI System
- RtReports 5.1
- Visualization
The Migrate-MdbToAF.ps1 PowerShell script migrates RtReports data (format templates, data templates, and configuration settings) from the PI Module Database (MDB) to Asset Framework (AF). The script updates the RtReports web.config file to use Asset Framework for template storage and also can run security settings.
Prerequisites:
-
PowerShell 5.0 or higher
-
OSISoft.RtReports.PIModuleImporter.exe and OSISoft.RtReports.SecuritySettings.exe available in the bin directory
-
AF SDK installed
-
Appropriate permissions on AF server and PI Data Archive
-
PIHOME environment variable set (if not specifying paths)
Parameters:
-
AFServerPath (required): Path on AF server where templates are stored. For example, \\<Server_Name>\<Template_Path>.
-
WebConfigPath (optional): Path to the RtReports web.config file. Defaults to $env:PIHOME\RtReports\web.config.
-
BinPath (optional): Path to the RtReports bin directory containing the required executables. Defaults to $env:PIHOME\RtReports\bin.
-
SkipSecuritySettings (optional): If specified, skips running security settings after migration.
Example Usage:
```
.\Migrate-MdbToAF.ps1 -AFServerPath "(\\<Server_Name>\<Template_Path>)"
.\Migrate-MdbToAF.ps1 -WebConfigPath "C:\inetpub\wwwroot\RtReports\web.config" -AFServerPath "(\\<Server_Name>\<Template_Path>)"
.\Migrate-MdbToAF.ps1 -WebConfigPath "C:\inetpub\wwwroot\RtReports\web.config" -AFServerPath "(\\<Server_Name>\<Template_Path>)" -BinPath "C:\Program Files (x86)\PIPC\RtReports\bin"
```
What the Script Does:
-
Backs up the web.config file.
-
Checks if MDB is currently used for templates.
-
Migrates templates and configuration from MDB to AF using PIModuleImporter.
-
Updates web.config to use AF.
-
Runs SecuritySettings.exe (unless `-SkipSecuritySettings` is specified).
-
Outputs post-migration instructions for relinking persisted strings in the RtReports Editor.
Post-Migration Steps:
-
Launch the RtReports Editor application.
-
Go to File → Admin → Templates Maintenance.
-
Click the Relink button to relink any persisted strings to the new AF templates on your AF server.