Using the Command Line Options

You can also run the Backup and Restore utility from the command line. This is especially useful if you want to automate the backup and restore operations through scripting or external programs.

The syntax for the BackupRestore.exe command line is as follows:

Syntax for Backup

BackupRestore.exe

[/FactoryDefault]

/B=<file name with full path>

[/F]

[/P=<project path> or /P=UseINI]

[/BackupSec]

[/S or /Y]

[/I=<ini file name>]

 

Syntax for Restore

BackupRestore.exe

[/FactoryDefault]

/R=<file name with full path>

[/A]

[/A=<project path> [/N=<node name>] [/X]]

[/P=<project path> or /P=UseINI]]

[/C]

[[/RestoreSec] or [/DelSec]]

[/NOIFD]

[/S or /Y]

[/I=<ini file name>]

Notes on the Syntax

  • The brackets ( [ ] ) indicate that a parameter is optional. The brackets are not part of a command; if a bracketed option is desired, type only the text that is inside the brackets, and not the brackets themselves.
  • Italics are used to represent the information that the user must supply to run the command. The information in italics is not typed exactly as it appears. Instead, the user enters the information specific to the italicized expression.

The following table lists the command line options available for BackupRestore.exe.

Available Command Options

Command Option

Description

/F

Specifies a Full Backup of all files within a project path, including security files.

/FactoryDefault

Performs a factory default backup or restore.

/P

Specifies the source project path for the Backup or the destination project path for the restore.

/P=UseINI

Specifies the source project path for the Backup or the destination project path for the Restore. Allows you to specify the full path for all sub-project paths within the INI file settings.

/A

Uses the archived SCU file to determine the destination project path of the Restore.

/A=<project path>

Specifies the destination project path for the Restore, and sets it to the extracted SCU file.

/N=<node name>

Specifies the node name of the node you want to restore. Used with the /A option.

/X

Specifies that you do not want to rename the current node name with the name of the restored node. Used with the /A option.

/C

Deletes all existing files under the selected project path before restoring a Custom or Full Backup file.

/BackupSec

Includes security files in the backup.

/RestoreSec

Replaces the current security settings with the security settings in the archived files during the restore.

/DelSec

Deletes all existing security files and disables security upon restore.

/NOIFD Do not restore default iFIX project files before restoring your backup files.

/S

Runs the Backup or Restore project in silent mode, with no progress bar or user prompt.

/Y

Automates the user prompt and displays the progress bar while the backup or restore runs in silent mode.

/I

Specifies an .INI file and path, if you want to use an .INI file other than the BackupRestore.ini file.

By default, Backup and Restore reads the BackupRestore.ini file in the Local folder. By using the /l command, you can specify another .INI file name. The format must be the same as the BackupRestore.ini file however. Refer to the Sample BackupRestore.ini section for more information.

/?

Opens the Help for the command line options.

NOTE: If you do not define the /P option while running a Backup, the source path is taken from the current SCU setting. If you do not define the /P or /A option while running a Restore, the destination is the current SCU setting.

Examples

This command performs a custom backup silently including security files, without displaying the Backup and Restore Wizard:

BackupRestore.exe /B="C:\Program Files (x86)\Proficy\iFIX\ProjectBackup\FIX.fbk" /S /BackupSec

This command performs a project restore to the current project path silently, without displaying the Backup and Restore Wizard:

BackupRestore.exe /R="C:\Program Files (x86)\Proficy\iFIX\ProjectBackup\FIX.fbk" /S /RestoreSec

This command performs a project restore to the project path archived in the SCU, and shows a progress bar for restore process:

BackupRestore.exe /R="C:\Program Files (x86)\Proficy\iFIX\ProjectBackup\FIX.fbk" /A /Y

NOTE: When including the /A command, you may need to review the SCU to see if the base path has changed.

This command performs a factory default backup, without displaying the Backup and Restore Wizard:

BackupRestore.exe /FactoryDefault /B="C:\Program Files (x86)\Proficy\iFIX\ProjectBackup\FIX.ifd" /S

This command performs a factory default restore, without displaying the Backup and Restore Wizard:

BackupRestore.exe /FactoryDefault /R="C:\Program Files (x86)\Proficy\iFIX\ProjectBackup\FIX.ifd" /S

Return Code

The Backup and Restore application returns the following exit codes after it runs.

Exit Code

Description

0

Backup or Restore action completed without errors.

When you run the user interface for the Backup and Restore, instead of using the command line, the exit code also will be 0.

1

Backup or Restore action aborted with an error. This usually indicates that the error occurred during the action. For example: a backup file was unable to be opened, a backup file is corrupted, or security settings could not be adjusted .

2

Backup or Restore action unable to start, for any reason. For example: an invalid command was detected, or a specified file was not found.

Also, when you run the BackupRestore.exe /? help command, the exit code is 2.

When the BackupRestore.exe program returns a 1 or 2, the action failed. If an error is detected before an action log file opens, these errors are recorded in the BackupRestoreDefaultLog.txt file. By default, this file is located in the iFIX base path. If you installed iFIX to the default location, then the base path is the C:\Program Files (x86)\Proficy\iFIX folder.

If a 1 or 2 is returned, look to the BackupRestoreDefaultLog.txt first for details on the error. If there is no information there, then look at actual action log (BackupLog.txt or RestoreLog.txt).

Be aware that the BackupRestoreDefaultLog.txt log also contains full command line parameter information and the time when the BackupRestore.exe program started.