Backing Up and Restoring Proficy Portal Files

To protect yourself against power surges, hardware failures, or accidental data loss, plan to back up your Proficy Portal data regularly. These scripts should be used for backing up and restoring the same version of Proficy Portal.

The following example scripts can be used to automate the backup and restore process. You must have the WinZip utility installed on your server for these scripts to work, and be sure to update directory paths as required. Use the first script (backupProficyPortalData.cmd) to back up the files and the second script (restoreProficyPortalData.cmd) to restore the files.

NOTE: The following scripts were tested with WinZip version 9.0, with the command line add-on for WinZip. The command line add-on is required.

The backupProficyPortalData.cmd and restoreProficyPortalData.cmd files can be placed anywhere on the same drive Proficy Portal is installed on, but do not have to be in the Proficy Portal directory. These files can be edited; however, if the paths are changed to include spaces, make sure the path is contained in quotation marks (e.g. set WINZIPADDRESS="C:\Program Files\WinZip").

The Backup command creates a directory in the Proficy Portal folder called 'backup'. The following are backed up:

After the Backup and Restore commands have been run, the backup directory will contain the following:

Ensure the Proficy Portal server is shut down before executing the Backup and Restore commands.

backupProficyPortalData.cmd

@echo off

rem ----------------------------------------------------------------

rem ENTER THE FOLDER IN WHICH THE FILE WZZIP.EXE IS SITUATED

rem ----------------------------------------------------------------

echo WinZip Address

set WINZIPADDRESS="C:\Program Files\WinZip"

set /P WINZIPADDRESS="[default] %WINZIPADDRESS% :"

rem ----------------------------------------------------------------

rem ENTER THE FOLDER IN WHICH PROFICY PORTAL IS INSTALLED

rem ----------------------------------------------------------------

echo Proficy Portal Address

set PROFICYPORTALADDRESS="C:\Program Files\GE Fanuc\Proficy Portal"

set /P PROFICYPORTALADDRESS="[default] %PROFICYPORTALADDRESS% :"

rem ----------------------------------------------------------------

rem CHANGING DIRECTORY SO PATHS ARE INDEPENDENT OF INSTALL LOCATION

rem ----------------------------------------------------------------

set OLDDIR=%CD%

CHDIR %PROFICYPORTALADDRESS%

MKDIR backup

rem ----------------------------------------------------------------

rem SETTING PATH TO ZIP FILE AND LOG FILE

rem ----------------------------------------------------------------

set ZIPFILE="backup\PRTIPbackup.zip"

set LOG="backup\backup.log"

rem ----------------------------------------------------------------

rem CREATING THE ZIP FILE HERE

rem ----------------------------------------------------------------

echo Preparing to create the zip file...

%WINZIPADDRESS%\wzzip -a -r -P -whs %ZIPFILE% webapps\infoAgentSrv\AllUsers\ >>%LOG%

echo AllUsers folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs %ZIPFILE% webapps\infoAgentSrv\QED >>%LOG%

echo QED folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs %ZIPFILE% webapps\infoAgentSrv\Roles >>%LOG%

echo Roles folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs %ZIPFILE% webapps\infoAgentSrv\Users >>%LOG%

echo Users folder added...

rem ----------------------------------------------------------------

rem THIS IS WHERE CONNECTOR FOLDERS ARE ADDED

rem ----------------------------------------------------------------

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\Alarms >>%LOG%

echo Alarms folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar -x*.pdb %ZIPFILE% webapps\infoAgentSrv\config\datasources\EDA >>%LOG%

echo EDA folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\iHistorian >>%LOG%

echo iHistorian folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\OPC >>%LOG%

echo OPC folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\PDB >>%LOG%

echo PDB folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\PeHistPt >>%LOG%

echo PeHistPt folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\PeRtp >>%LOG%

echo PeRtp folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\PI >>%LOG%

echo PI folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\SQL >>%LOG%

echo SQL folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs -x*.jar %ZIPFILE% webapps\infoAgentSrv\config\datasources\VisualSPC >>%LOG%

echo VisualSPC folder added...

rem ----------------------------------------------------------------

rem DELETING PATH SPECIFIC CONFIG FILES

rem ----------------------------------------------------------------

%WINZIPADDRESS%\wzzip -d %ZIPFILE% webapps\infoAgentSrv\config\datasources\Alarms\Config.xml webapps\infoAgentSrv\config\datasources\EDA\Config.xml webapps\infoAgentSrv\config\datasources\iHistorian\Config.xml webapps\infoAgentSrv\config\datasources\OPC\Config.xml webapps\infoAgentSrv\config\datasources\PDB\Config.xml webapps\infoAgentSrv\config\datasources\PeHistPt\Config.xml webapps\infoAgentSrv\config\datasources\PeRtp\Config.xml webapps\infoAgentSrv\config\datasources\PI\Config.xml webapps\infoAgentSrv\config\datasources\SQL\Config.xml webapps\infoAgentSrv\config\datasources\VisualSPC\Config.xml >>%LOG%

echo deleting unneeded config files >>%LOG%

%WINZIPADDRESS%\wzzip -a -r -P -whs %ZIPFILE% webapps\infoAgentSrv\config\RIFServ >>%LOG%

echo RIFServ folder added...

%WINZIPADDRESS%\wzzip -a -r -P -whs %ZIPFILE% webapps\infoAgentSrv\maps >>%LOG%

echo maps folder added...

%WINZIPADDRESS%\wzzip -a -P -whs %ZIPFILE% webapps\infoAgentSrv\WEB-INF\*.xml >>%LOG%

echo Policy.xml and Web.xml added...

CHDIR %OLDDIR%

 

To back up

  1. Ensure the WinZip command line add-on is installed.

  2. Shut down the Proficy Portal server.

  3. Double-click backupProficyPortalData.cmd

  4. Follow the prompts. If the paths are correct, press ENTER; if the paths are not correct, change them.

  5. When the backup is complete, start the Proficy Portal server.

restoreProficyPortalData.cmd

@echo off

rem ---------------------------------------------------------------------

rem Enter the folder in which the file wzunzip.exe is situated

rem ---------------------------------------------------------------------

echo Enter WinZip Address

set WINZIPADDRESS="C:\Program Files\WinZip"

set /P WINZIPADDRESS="[default] %WINZIPADDRESS% :"

rem ---------------------------------------------------------------------

rem Enter the folder in which Proficy Portal is installed

rem ---------------------------------------------------------------------

echo Enter Proficy Portal Address

set PROFICYPORTALADDRESS="C:\Program Files\GE Fanuc\Proficy Portal"

set /P PROFICYPORTALADDRESS="[default] %PROFICYPORTALADDRESS% :"

rem ---------------------------------------------------------------------

rem Enter the path to the Proficy Portal backup file

rem ---------------------------------------------------------------------

echo Enter Path to Backup Zip File

set BACKUPADDRESS=%PROFICYPORTALADDRESS%"\backup\PRTIPbackup.zip"

set /P BACKUPADDRESS="[default] %BACKUPADDRESS% :"

MKDIR %PROFICYPORTALADDRESS%\backup

rem ---------------------------------------------------------------------

rem Extracting all files from the zip file to their appropriate path here

rem ---------------------------------------------------------------------

echo Extracting the files from the zip file...

%WINZIPADDRESS%\wzunzip -e -d -yo -o -Jhrs %BACKUPADDRESS% %PROFICYPORTALADDRESS% >>%PROFICYPORTALADDRESS%"\backup\restore.log

echo All files extracted

To restore

  1. Ensure the WinZip command line add-on is installed.

  2. Shut down the Proficy Portal server.

  3. Double-click restoreProficyPortalData.cmd

  4. Follow the prompts. If the paths are correct, press ENTER; if the paths are not correct, change them.

  5. Check the log file to verify that files were extracted to the intended directories. If no log file exists, then the restore was not successful.

  6. When you are finished restoring, start the Proficy Portal server.

NOTE: When restoring, do not overwrite existing files.

NOTE: A role that does not have at least one user associated with it will not be restored.