This article only concerns PI Data Archive versions 3.4.364 and earlier. You can find documentation for current versions in the PI Data Archive System Management Guide
. Other version-specific articles can be found in the
This KB article addresses the following topics regarding backing up your PI Server 3.4.364 and earlier:
Documentation regarding backups
Refer to the PI Server System Management Guide
(Chapter 1, Section "Backing up PI") for under-the-hood details on the topic, including how to avoid data loss during backup, what additional backups need to be made, and how often.
Obtaining PI backup scripts for PI Server 3.4.364 and earlier
The latest PI Backup Scripts
for PI Server 3.4.364 and earlier are available on the Tech Support website in the Download center. Do not install PI 3.4.370 scripts for PI Server 3.4.364 and earlier. To get scripts for 3.4.364 and earlier:
- Go to the "PI 3 Enterprise Server" page on the support site, and select Extras.
- Download "PI Backup Scripts for PI 3.4.364 and earlier and 3.3 SR2" and save to a location on the PI Server.
- Unzip the files. There are three batch files included in the backup script:
- If you are already using backup scripts, make copies of your current backup scripts before copying these newer scripts to the production PI Server. Backup scripts are typically installed to the pi\adm directory. Compare the current scripts with the new ones, and update the newer scripts as necessary to include any site-specific commands.
Automating backups in PI Server 3.4.363 and earlier
It is recommend that you install the backup script to run automatically with Windows Scheduled Tasks. To automate this procedure, make sure the Task Scheduler service is running and set to "automatic" startup. Follow the instructions below to schedule the backup to run nightly or when there is the least activity on the PI Server. By default, automatic scripts are set to run daily at 2:00 A.M. (see
Changing the time of the scheduled PI backup script
below). Also, be sure to copy completed backups off the production server regularly to insure you have a backup in case of hardware failure.
script file takes three arguments:
- The current PI installation directory: i.e., d:\pi
- The backup directory: i.e., d:\pi\backup
- The number of most recent archives to backup in addition to the primary: i.e., "1" will do both the primary archive 0 and the second most recent archive.
NOTE: This behavior has changed in more recent versions of the PI Server. Please see KB00845 for details.
Scheduling the PI Backup Script to run automatically
- Open a command window by selecting Start > Run, then typing cmd.
- Type the following at the prompt, substituting your existing PI installation and backup directories as well as the number of archives you want to be backed up in addition to the primary archive:
pibackup d:\pi d:\pi\backup 1 –install
NOTE: Running this command performs a back up and the optional "-install" will also install the backup script as a scheduled task. Only the scheduled backup will generate a log file. Open a command prompt and type at. Press Enter to verify that it’s set to run automatically.
What the backup script files do in 3.4.364 and earlier
In PI Server 3.4.364 and earlier, pibackup.bat
which calls pisitebackup.bat
, if it exists. The pibackupat.bat script is used when running backups as a scheduled service and it calls pibackup.bat. When you install pibackup.bat as a task (with the -install
is used automatically.
What is backed up and how it is done in 3.4.364 and earlier
In PI 3.4.364 and earlier, the backup scripts back up files in the \dat
subdirectories of the \pi
directory and as many archives you specify (see example below). It checks the archive shift status and will delay up to 30 minutes if a shift is in progress or scheduled within five minutes.
The backup script carefully shuts down certain subsystems in order to back up various PI databases without losing data, such as the points database, user and groups, digital states, digital sets, module database, batches, etc. Just backing up the archive by running piartool -be
, copying the file, then running piartool -bs
will only back up the archive, which is not sufficient for a full PI system backup. See the PI Server System Management Guide
(Chapter 1) for details on piartool
Changing the time of the scheduled PI backup script
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 the 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
- Whether running a VSS or non-VSS backup, you can check the target directory of the PI backup for log files called "pibackup date.txt." Note that this log is only generated from automatic backups (running as a scheduled task), not when you run the command interactively at the command prompt.
- You can also check the PI Message log file to see if there are any errors from the backup. Even if you see success statements in the log file, it doesn't necessarily mean there were no errors.
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