Migrate Alarms and Events at a Command Prompt

Before you begin

Back up the alarms and events data.

Procedure

  1. Run the ihBackupAlarms.exe file. By default, it is located at C:\Program Files\Proficy\ProficyHistorian\Server\ihBackupAlarms.exe
  2. Use the following parameters to migrate data:
    arameter Description
    /TASK Specify whether you want to back up or restore data. Enter one of the following values:
    • BACKUP
    • RESTORE
    This parameter is required.
    /SERVER Enter the SQL server instance name in which the backup file is stored. This parameter is required.
    /DBNAME Enter the name of the database using which you have backed up the data. Typically, this will be the same as the SQL Server you are currently using. This parameter is required.
    /SDATETIME Enter the start time from which you want to migrate alarms. Enter a value in the following format: mm/dd/yyyy HH:MM:ss (for example 5/21/2023 10:20:30). Alarms and events data collected from this time will be considered. This parameter is mandatory if you are backing up alarms.
    /EDATETIME Enter the end time up to which you want to migrate alarms. Enter a value in the following format: mm/dd/yyyy HH:MM:ss (for example 5/21/2023 10:20:30). Alarms and events data collected from this time will be considered. This parameter is mandatory if you are backing up alarms.
    /BKPPATH Fully qualified path of the .dat file where the backup of the database will be taken. This parameter is mandatory if you are backing up alarms.
    /RSTPATH Fully qualified path of the .dat file from where the database will be restored. This parameter is mandatory if you are restoring alarms.
    /USERNAME Enter the Windows or SQL server username to connect to the SQL server. If you do not provide this parameter, Windows authentication is used.
    /PWD Enter the Windows or SQL server password to connect to the SQL server. By default, the password is blank, but we recommend that you enter a password.
    To back up using SQL authentication:
    Proficy.Historian.AandE.Migration.exe /TASK=Backup 
    /SERVER=CPHIST45\PROFICYHIST /DBNAME=CPHIST45_plantdatabase
    /SDateTime="3/9/2013 21:00:00" /EDateTime="3/9/2013 23:59:59"
    /BKPPATH=C:\temp\PDB_0309.dat /USERNAME=sa /PWD=Pr0f1cyhist
    To back up using Windows authentication:
    Proficy.Historian.AandE.Migration.exe /TASK=Backup 
    /SERVER=Domain\Node /DBNAME=AEDB /SDateTime="5/10/2012 10:20:30" 
    /EDateTime="6/10/2012 10:20:30" /BKPPATH=E:\DBBkpPath\AEDB_1.dat
    To restore using SQL authentication:
    Proficy.Historian.AandE.Migration.exe /TASK=Restore 
    /SERVER=CPHIST45\PROFICYHIST /DBNAME=CPHIST45_AEDatabase 
    /RSTPATH=C:\temp\PDB_0309.dat /USERNAME=sa /PWD=Pr0f1cyhist
    To restore using Windows Authentication:
    Proficy.Historian.AandE.Migration.exe /TASK=RESTORE 
    /SERVER=Domain\Node /DBNAME=AEDB /RSTPATH=E:\DBBkpPath\AEDB_1.dat 
    To perform multiple back ups using a batch file:
    cd C:\Program Files\Proficy\Proficy DataBase
    start/b/wait Proficy.Historian.AandE.Migration.exe /TASK=Backup
    /SERVER=CPHIST45\PROFICYHIST /DBNAME=CPHIST45_plantdatabase 
    /SDateTime="3/9/2013 21:00:00" /EDateTime="3/9/2013 23:59:59" 
    /BKPPATH=C:\temp\PDB_0309.dat /USERNAME=sa /PWD=Pr0f1cyhist
    start /b /wait Proficy.Historian.AandE.Migration.exe /TASK=Backup 
    /SERVER=CPHIST45\PROFICYHIST /DBNAME=CPHIST45_plantdatabase 
    /SDateTime="3/10/2013 00:00:00" /EDateTime="3/10/2013 02:00:00" 
    /BKPPATH=C:\temp\PDB_0310_1.dat /USERNAME=sa /PWD=Pr0f1cyhist 
    start /b /wait Proficy.Historian.AandE.Migration.exe /TASK=Backup
    /SERVER=CPHIST45\PROFICYHIST /DBNAME=CPHIST45_plantdatabase
    /SDateTime="3/10/2013 02:00:00" /EDateTime="3/10/2013 04:00:00"
    /BKPPATH=C:\temp\PDB_0310_2.dat /USERNAME=sa /PWD=Pr0f1cyhist 

    To perform multiple restores using a batch file:

    Multiple Restores Using a Batch File:

    cd C:\Program Files\Proficy\Proficy DataBase 
    start/b/wait Proficy.Historian.AandE.Migration.exe /TASK=Restore
    /SERVER=CPHIST45\PROFICYHIST /DBNAME=CPHIST45_AEDatabase
    /RSTPATH=C:\temp\PDB_0309.dat /USERNAME=sa /PWD=Pr0f1cyhist
    start /b /wait Proficy.Historian.AandE.Migration.exe /TASK=Restore 
    /SERVER=CPHIST45\PROFICYHIST /DBNAME=CPHIST45_AEDatabase
    /RSTPATH=C:\temp\PDB_0310_1.dat /USERNAME=sa /PWD=Pr0f1cyhist
    start /b /wait Proficy.Historian.AandE.Migration.exe
    /TASK=Restore /SERVER=CPHIST45\PROFICYHIST /DBNAME=CPHIST45_AEDatabase
    /RSTPATH=C:\temp\PDB_0310_2.dat /USERNAME=sa /PWD=Pr0f1cyhist
    Note: Parameter values with spaces must be enclosed within quotation marks.