The restore command restores a backup of a directory server back end.
This command is not supported for the proxy.
restore options
The restore command restores a backup of a directory server back end. Only one back end can be restored at a time. You can use this command to perform a restore operation immediately, or to schedule a restore to run at a later time. For more information, see Configuring Commands As Tasks in Sun OpenDS Standard Edition 2.2 Administration Guide.
You can restore a back end when the server is offline or schedule a task when the server is online to restore a back end at a later stage. If the server is online, the restore command connects to the server over SSL through the administration connector. For more information about the administration connector, see Managing Administration Traffic to the Server in Sun OpenDS Standard Edition 2.2 Administration Guide.
The restore command accepts an option in either its short form (for example, -I backupID) or its long form equivalent (for example, --backupID backupID).
Restore using the directory that contains the backup archive. This directory must exist and must contain a backup descriptor file and one or more backups for a given back end. The backup descriptor file is read to obtain information about the available backups and the options used to create them. This is a required option.
Specify the backup ID of the backup to be restored. If this option is not provided, the latest backup contained in the backup directory is restored.
Display information about the available backups contained in the backup directory. This option causes the command to exit without performing any restore.
Verify that the specified backup is valid (that is, ensure that it appears to be a valid archive, and that any hash, signature matches its contents, or both). This option does not actually attempt to restore the backup.
Running an online restore requires access to the tasks back end. Access to the tasks back end is provided over SSL through the administration connector. These connection options are used when the restore runs online.
Use the bind DN to authenticate to the directory server. This option is used when performing simple authentication and is not required if SASL authentication is to be used. The default value for this option is cn=Directory Manager.
Contact the directory server on the specified hostname or IP address. If this option is not provided, a default of localhost is used.
Use the bind password in the specified file when authenticating to the directory server. This option must not be used in conjunction with --bindPassword.
Use the client keystore certificate in the specified path.
Use the specified certificate for client authentication.
Use the specified options for SASL Authentication.
Contact the directory server at the specified administration port. If this option is not provided, a default administration port of 4444 is used.
Use the client trust store certificate in the specified path. This option is not needed if --trustAll is used, although a trust store should be used when working in a production environment.
Use the password needed to access the certificates in the client trust store. This option is only required if --trustStorePath is used and the specified trust store requires a password in order to access its contents (which most trust stores do not require). This option must not be used in conjunction with --trustStorePasswordFile.
Use the password in the specified file to access the certificates in the client keystore. This option is only required if --keyStorePath is used. This option must not be used in conjunction with --keyStorePassword.
Use the password in the specified file to access the certificates in the client trust store. This option is only required if --trustStorePath is used and the specified trust store requires a password in order to access its contents (most trust stores do not require this). This option must not be used in conjunction with --trustStorePassword.
Use the bind password when authenticating to the directory server. This option can be used for simple authentication as well as password-based SASL mechanisms. This option must not be used in conjunction with --bindPasswordFile. To prompt for the password, type -w -.
Use the password needed to access the certificates in the client keystore. This option is only required if --keyStorePath is used. This option must not be used in conjunction with --keyStorePasswordFile.
Trust all server SSL certificates that the directory server presents. This option can be used for convenience and testing purposes, but for security reasons a trust store should be used to determine whether the client should accept the server certificate.
Specify the email address of a recipient to be notified when the task completes. This option can be specified more than once in a single command.
Specify the ID of a task upon which this task depends. A task does not start executing until all of its dependencies have completed execution.
Specify the email address of a recipient to be notified if an error occurs when this task executes. This option can be specified more than once in a single command.
Specify the action this task will take should one if its dependent tasks fail. The value must be one of PROCESS,CANCEL,DISABLE. If not specified, the backup defaults to CANCEL.
Indicates that the task is recurring and will be scheduled according to the schedulePattern, expressed as a crontab(5) compatible time and date pattern.
Indicates the date and time at which the operation starts when scheduled as a directory server task expressed in the format YYYYMMDDhhmmss. A value of 0 causes the task to be scheduled for immediate execution. When this option is specified, the operation is scheduled to start at the specified time after which this command exits immediately.
Indicate that a properties file will not be used to get the default command-line options.
Specify the path to the properties file that contains the default command-line options.
Display command-line usage information for the command and exit without making any attempt to stop or restart the server.
Display the version information for the directory server and exit rather than attempting to run this command.
The following examples show how to use the directory server commands. You can use the commands on any UNIX, Linux, or Windows system that has at least the Java SE 5 (at least Sun version 1.5.0_08, preferably the latest version of Java SE 6) runtime environment installed on its target system. For more information, see Sun OpenDS Standard Edition System Requirements in Sun OpenDS Standard Edition 2.2 Installation Guide.
The following command lists (-l) the backup information in the backup descriptor file (backup.info) for the directory server. You can use this option to display backup information whether the server is running or stopped.
$ restore -l -d /tmp/backup/userRoot Backup ID: 20081016050258Z Backup Date: 16/Oct/2008:09:30:00 +0200 Is Incremental: false Is Compressed: true Is Encrypted: true Has Unsigned Hash: false Has Signed Hash: true Dependent Upon: none
The following command restores a back end from the backup directory. You can only restore one back end at a time. The server must be stopped before you run this command.
$ stop-ds $ restore -d /tmp/backup/userRoot [16/Oct/2008:10:32:52 +0200] category=JEB severity=NOTICE msgID=8847445 msg=Restored: 00000000.jdb (size 321954)
Restoring a hashed or encrypted backup requires a connection to an online server instance, over SSL through the administration connector. When you restore an encrypted backup, you must therefore specify the connection details, including the host, administration port, bind DN and bind password. You must also specify the certificate details for the SSL connection.
The following command restores an encrypted, hashed backup. The self signed certificate is trusted using the -X (--trustAll) option.
$ restore -h localhost -p 4444 -D "cn=directory manager" -w password -X \ -d /tmp/backup/userRoot/ Restore task 2008101610403710 scheduled to start immediately [16/Oct/2008:10:40:38 +0200] severity="NOTICE" msgCount=0 msgID=9896306 message="The backend userRoot is now taken offline" [16/Oct/2008:10:40:39 +0200] severity="NOTICE" msgCount=1 msgID=8847445 message="Restored: 00000000.jdb (size 331434)" [16/Oct/2008:10:40:40 +0200] severity="NOTICE" msgCount=2 msgID=8847402 message="The database backend userRoot containing 102 entries has started" Restore task 2008101610403710 has been successfully completed
Scheduling a restore requires online access to the tasks back end. Access to this back end is provided over SSL through the administration connector. When you schedule a restore, you must therefore specify the connection details, including the host, administration port, bind DN and bind password. You must also specify the certificate details for the SSL connection.
The following command schedules a task to restore the userRoot back end at a specific start time by using the --start option. The command sends a completion and error notification to admin@example.com. The self signed certificate is trusted using the -X (--trustAll) option.
You can view this scheduled task by using the manage-tasks command. For more information, see Configuring Commands As Tasks in Sun OpenDS Standard Edition 2.2 Administration Guide. You must ensure that the server is running prior to the scheduled restore date and time.
$ restore -h localhost -p 4444 -D "cn=directory manager" -w password -X \ -d /backup/userRoot --start 20081025121500 --completionNotify admin@example.com \ --errorNotify admin@example.com Restore task 2008101610442610 scheduled to start Oct 25, 2008 12:15:00 PM SAST
An exit code of 0 indicates that the operation completed successfully. An exit code of 1 indicates that an error occurred during processing.
The directory server supports the use of a properties file that passes in any default option values used with the restore command. The properties file is convenient when working in different configuration environments, especially in scripted or embedded applications. For more information, see Using a Properties File With Server Commands.
UNIX and Linux: install-dir/bin/restore
Windows: install-dir\bat\restore.bat