This article only concerns PI Data Archive versions 3.4.370 to 3.4.375. You can find documentation for current versions in the PI Data Archive System Management Guide
. Other version-specific articles can be found in the
Use PI Backup scripts for safe and complete daily backups of archives, point and group databases, modules, batches (if they exist), and log files. This KB article addresses the following topics on backing up your PI Server 3.4.370 and PI Server 3.4.375:
The PI Server backup functionality changed starting with PI Server 3.4.380. KB00311
describes these improvements. For information on backing up PI Server 3.4.380 and later, please consult the PI Data Archive System Management Guide
For information on backing up PI Server 3.4.364 and earlier, please consult KB00844
Documentation on PI Server backups
PI Server3.4.370 Backups:
The PI 3.4.370 Installation and New Features Guide (this guide was published in October 2005 and is no longer available for download. If you need a copy, contact Tech Support
) describes the PI Server Backup subsystem for managing backups. The PI Backup subsystem takes advantage of Volume Shadow Copy Services (VSS) on Windows 2003 Server and Windows XP to perform backups. The pibackup.bat backup script automatically determines whether or not VSS is supported and performs either a VSS or non-VSS backup as appropriate.
PI Server 3.4.375 Backups:
VSS backups no longer use NTBackup.exe; therefore, VSS backup files are no longer packed into a *.bkf file, but are loose files visible in the backup directory. Also, the pibackup.bat file defaults to full backups on Monday and incremental backups on the other days. See Chapter 5 in the PI High Availability and PI Server Replication User Manual (PR1)
for discussion of the new backup features of PI Server 3.4.375.
Finding PI Server backup scripts
is installed automatically to the pi\adm
folder when you install PI Server 3.4.370. The pibackupat.bat and pibackupclusterat.bat files are no longer installed or used by this version of the PI Server. The replacement file, pibackuptask.bat
, is installed.
Backup scripts for PI Server 3.4.370 and PI Server 3.4.375 can be downloaded from the OSIsoft Technical Support Download Center under PI 3 Enterprise Server Extras
See Live Library
for information on how the PI backup scripts work.
Automating backups in PI Server 3.4.370 and 3.4.375
To automate backups, make sure the Windows Task Scheduler service is running (Administrative Tools> Services> Properties
) and set it to startup type "Automatic." Next, follow the instructions below to schedule the backup to run nightly or when there is the least amount activity on the PI Server.
By default, PI Server 3.4.370 and later backup scripts are set to run daily at 3:15 A.M. To change the scheduled time, read the section
Viewing or editing a scheduled backup task
The pibackup.bat script in 3.4.370 file takes four arguments:
PIbackup.bat <path for backups>
[number of archives]
[archive cutoff date] -install
where < > indicates a required parameter and [ ] indicates an optional parameter.
- The path for backups is where to you want the backups to be created: i.e., d:\pi\backup. (You no longer need to specify where the PI archives you are going to back up reside, as you did in PI 3.4.364 and earlier.)
- The number of archives to backup includes the primary. If you specify "1," then only the primary archive is backed up. (This parameter has changed since PI 3.4.364).
- The archive cutoff date specifies how far back in time to back up. For example, if you want to back all archives that contain data for the last ten days you could use "-10d."
- The "-install" option installs the backup as a scheduled task (recommended).
* The more restrictive parameters of "-numarch <number>" and "-cutoff <date>" take precedence.
Scheduling the PI Backup Script to run automatically
- Open a command window by selecting Start > Run, then typing cmd.
- Type the pibackup.bat command followed by the parameters you want. For example:
pibackup.bat d:\pi\backup 3 –install
NOTE: Running this command creates a Windows Scheduled Task that will back up three archives, including the primary archive, to the d:\pi\backup directory.
Viewing or editing a scheduled backup task
Look under the Control Panel> Scheduled Tasks
to see the task. In Windows XP or Windows Server 2003, it will be called "PI Server Backup," whereas in Windows Server 2000, it will be called ATn
, where "n" is a number. You can right-click on the task and choose Properties
to view or edit the schedule.
In Windows XP or 2003 Server, you can also type schtasks
at a command prompt and press Enter
. Your task will look something like this:
TaskName Next Run Time Status
PI Server Backup 03:15:00, 11/3/2005
Removing the scheduled backup task
To delete the PI Backup scheduled task:
- Go to Control Panel > Scheduled Tasks.
- Locate the PI Backup task, right-click on it, and choose Delete.
- Confirm that it is removed by typing schtasks or at from a command prompt. The scheduled task should no longer appear.
Finding backup logs and verifying successful backups
- It is recommended that you check the backup log every time the scheduled task is run. With both scheduled and non-scheduled backups, you can check the PI message log for backup success using the pigetmsg command or PI System Management Tools (PI SMT) Message Logs plug-in.
- If you set up backups to run automatically as a scheduled task, individual backup logs are written to the target directory of the PI backup. The log file is called "pibackup (date).txt."
- If running a VSS backup, you can check the NTBackup log file. Search the PI Server Documents and Settings folder for NTBackup log files "backup*.log." If you've been running backups nightly, you'll have several log files. Sort by date and open the newest one. See the PI 3.4.370 Installation and New Feature Guide for details
Restoring from a VSS backup
To do a complete restore from a hardware failure, first install the PI 3.4.370.x software and then run NTBackup and choose the restore options. This will restore the backup file PI_Backup.bkf
. Please consult the PI 3.4.370 Installation and New Features Guide
for detailed information before performing a restoration.
Daily PI Server backups using the backup scripts are only one part of the recommended backup procedure. This will only keep a backup of the current state of the PI Server with no historical backups. If a problem occurs and is not identified before the next backup is run, then it will be impossible to roll back to a previous configuration. Historical backups must be created using a third-party backup application in order to keep a historical record of the PI Server configuration.
The recommended backup procedure for the PI Server is performed in two steps:
- Backup the PI Server daily using the PI Server backup scripts as described above. This creates a backup of the current state of the PI Server.
- Use a third-party backup application to create a historical backup of the resulting PI Server backup