Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Powershell

NewPIBackupRestoreFile Class

  • Last UpdatedDec 15, 2025
  • 3 minute read
NewPIBackupRestoreFile Class

Create a new archive manager data file

The New-PIBackupRestoreFile cmdlet creates a new backup restore file for a PI Data Archive. This is the PI Archive Manager Data file (piarstat.dat) and can be used for updating archive registry on secondary nodes when creating or reinitializing a collective.

The connection parameter specifies which connection to a PI Data Archive to use.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellNewPIBackupRestoreFile

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)

Syntax

[CmdletAttribute("New", "PIBackupRestoreFile", SupportsShouldProcess = true)]
public class NewPIBackupRestoreFile : OSICmdletBase
<CmdletAttribute("New", "PIBackupRestoreFile", SupportsShouldProcess := true)>
Public Class NewPIBackupRestoreFile
	Inherits OSICmdletBase

Dim instance As NewPIBackupRestoreFile
[CmdletAttribute(L"New", L"PIBackupRestoreFile", SupportsShouldProcess = true)]
public ref class NewPIBackupRestoreFile : public OSICmdletBase
[<CmdletAttribute("New", "PIBackupRestoreFile", SupportsShouldProcess = true)>]
type NewPIBackupRestoreFile =  
    class
        inherit OSICmdletBase
    end

The NewPIBackupRestoreFile type exposes the following members.

Constructors

  NameDescription
Public method
NewPIBackupRestoreFile

Properties

  NameDescription
Public property
ArchiveSetDirectories

Each archive set can have a separate directory. The array passed should have two elements. The first is the historical archive directory and the second is the future archive directory.

This option is only valid for PI Data Archive 2015 or later.

Public property
Connection

Connection to a PI Data Archive from which to retrieve backup state

Public property
HistoricalArchiveDirectory

Directory on the secondary node where the historical archive files are located

Public property
NumberOfArchives

Number of archives to include as registered for the secondary node

Note: This parameter does not apply to future archive set. All future archives are included.

Public property
OutputDirectory

Output directory for the resulting archive manager data file

Examples

Get-PIBackupRestoreFile -OutputDirectory D:\PIBackup -HistoricalArchiveDirectory "F:\PI\PIArchives" -NumberOfArchives 50 -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

This example will create a copy of the current archive manager data file (piarstat.dat) in the D:\PIBackup directory. The resulting file will include the archive registration information for the 50 most recent historical archives on the "PISRV1" PI Data Archive.

Examples

Get-PIBackupRestoreFile -OutputDirectory D:\PIBackup -ArchiveDirectories "F:\PI\HistPIArchives","H:\PI\FuturePIArchives" -NumberOfArchives 15 -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

This example will create a copy of the current archive manager data file (piarstat.dat) in the D:\PIBackup directory. The resulting file will include the archive registration information for the 15 most recent historical archives and all the future archives on the "PISRV1" PI Data Archive.

Note this example only potentially applies to PI Data Archive 2015 or later.

See Also

TitleResults for “How to create a CRG?”Also Available in