Hitachi Energy
Local Restore via Command Line
If the “//opt/nem/etc/database.conf”configuration file has been edited as described above, in particular, the “local_backup_device” has been set to the appropriate value, then the database can be restored by entering the command:
 
edbrestore
 
The edbrestore command has the following options:
 
[nemadmin@nemsrv ~]$ edbrestore --help
 
Usage: edbrestore [OPTION]
 
Options:
 
-b,
--backup=FILENAME
Backup device name. This parameter is optional.
The default value first is defined by the variable 'local_backup_device' of the 'database.conf' file. If package is encrypted, script prompts to password.
-d,
--database=DB_NAME
Database name. This parameter is optional.
The default value is defined by the variable 'database' of the 'database.conf' file.
-f,
--force-full-restore
Force full restore of all files. No files are preserved during restore.
-l,
--show-backup-info
List the backup information.
-u,
--list-user-backups
Show user backup list.
-w,
--without-progress-cursor
Without progress cursor. This parameter is optional.
The default behavior is with progress cursor.
-i,
--ignore-db-name
Ignore the database name in the backup file. Use the default database name or the given name with the option -d
-e,
--run-hook-explicit
Run pre/post execution hook script(s) explicitly. This parameter is optional. (see also database.conf, edbrestore_hook_uncond)
-a,
--run-agents-fix
Run the 'edb_fix_agents' script. This parameter is optional.
-x,
--restore-influx-data
Restore influx data if present in the backup. This parameter is optional
-p,
--password=PASSWORD
Before restore procedure, decrypt input file with provided password. This parameter is optional
-o,
-output-logs-filepath=FILEPATH
Filepath where logs from script are stored.
This parameter is optional. Default: /opt/nem/var/log/edbrestore_<current_datetime>.log
-s,
--suspend-agents
Make agents suspended when starting NEM after restore.
This parameter is optional
-h,
--help
Print this message.
 
Examples: edbrestore -b /dev/rmt/0mnb -d NEM_DATABASE
edbrestore -b /local/nem/nemdatabase.bck -d NEM_DATABASE
edbrestore -b /local/nem/nemdatabase.bck -d NEM_DATABASE -r passwd
edbrestore -l -b /local/nem/nemdatabase.bck
edbrestore -o /home/nemsec/edbrestore_important_day.log -b /local/nem/nemdatabase.bck
 
The output of the command “edbrestore” should look similar to the one shown below:
 
Starting 'NEM Database Restore'
===============================
 
Unpacking backup data : Performed
Removing the old BP database 'NEM_DATABASE' : Performed
Removing the old PM database 'PM_DATABASE' : Performed
Create a new BP database 'NEM_DATABASE' : Performed
Create a new PM database 'PM_DATABASE' : Performed
Restoring BP database 'NEM_DATABASE' : Performed
Restoring PM database 'PM_DATABASE' : Performed
Restoring alarms file(s) : Performed
Restoring DIRAC backup : Performed
Restoring additional files : Performed
 
The 'NEM Database Restore' has completed successfully.
* 
Please note: 
To restore the backup files from a remote server, you can use hookscripts. Please refer to /opt/nem/etc/database.conf file for hookscripts related parameters to configure. For further support, please contact customer support.