restore
Prev | Directory Server Tools | Next

## Name

restore — restore OpenDJ directory data backups

## Synopsis

`restore`

## Description

This utility can be used to restore a backup of a Directory Server backend.

## Options

The restore command takes the following options:

Command options:

`-d | --backupDirectory {backupDir}`

  Path to the directory containing the backup file(s).

`-I | --backupID {backupID}`

  Backup ID of the backup to restore.

`-l | --listBackups`

  List available backups in the backup directory.

  Default: false

`-n | --dry-run`

  Verify the contents of the backup but do not restore it.

  Default: false

`--offline`

  Indicates that the command must be run in offline mode.

  Default: false

Task Backend Connection Options

`--connectTimeout {timeout}`

  Maximum length of time (in milliseconds) that can be taken to establish a connection. Use '0' to specify no time out.

  Default: 30000

`-D | --bindDN {bindDN}`

  DN to use to bind to the server.

  Default: cn=Directory Manager

`-h | --hostname {host}`

  The fully-qualified directory server host name that will be used when generating self-signed certificates for LDAP SSL/StartTLS, the administration connector, and replication.

  Default: localhost.localdomain

`-j | --bindPasswordFile {bindPasswordFile}`

  Bind password file.

`-K | --keyStorePath {keyStorePath}`

  Certificate key store path.

`-N | --certNickname {nickname}`

  Nickname of the certificate that the server should use when accepting SSL-based connections or performing StartTLS negotiation.

`-o | --saslOption {name=value}`

  SASL bind options.

`-p | --port {port}`

  Directory server administration port number.

  Default: 4444

`-P | --trustStorePath {trustStorePath}`

  Certificate trust store path.

`-T | --trustStorePassword {trustStorePassword}`

  Certificate trust store PIN.

`-u | --keyStorePasswordFile {keyStorePasswordFile}`

  Certificate key store PIN file. A PIN is required when you specify to use an existing certificate as server certificate.

`-U | --trustStorePasswordFile {path}`

  Certificate trust store PIN file.

`-w | --bindPassword {bindPassword}`

  Password to use to bind to the server. Use -w - to ensure that the command prompts for the password, rather than entering the password as a command argument.

`-W | --keyStorePassword {keyStorePassword}`

  Certificate key store PIN. A PIN is required when you specify to use an existing certificate as server certificate.

`-X | --trustAll`

  Trust all server SSL certificates.

  Default: false

Task Scheduling Options

`--completionNotify {emailAddress}`

  Email address of a recipient to be notified when the task completes. This option may be specified more than once.

`--dependency {taskID}`

  ID of a task upon which this task depends. A task will not start execution until all its dependencies have completed execution.

`--errorNotify {emailAddress}`

  Email address of a recipient to be notified if an error occurs when this task executes. This option may be specified more than once.

`--failedDependencyAction {action}`

  Action this task will take should one if its dependent tasks fail. The value must be one of PROCESS,CANCEL,DISABLE. If not specified defaults to CANCEL.

`--recurringTask {schedulePattern}`

  Indicates the task is recurring and will be scheduled according to the value argument expressed in crontab(5) compatible time/date pattern.

`-t | --start {startTime}`

  Indicates the date/time at which this operation will start when scheduled as a server task expressed in YYYYMMDDhhmmssZ format for UTC time or YYYYMMDDhhmmss for local time. A value of '0' will cause the task to be scheduled for immediate execution. When this option is specified the operation will be scheduled to start at the specified time after which this utility will exit immediately.

Utility input/output options:

`--noPropertiesFile`

  No properties file will be used to get default command line argument values.

  Default: false

`--propertiesFilePath {propertiesFilePath}`

  Path to the file containing default property values used for command line arguments.

General options:

`-V | --version`

  Display Directory Server version information.

  Default: false

`-H | --help`

  Display this usage information.

  Default: false

## Exit Codes

0

  The command completed successfully.

> 0

  An error occurred.

## Examples

The following example schedules a restore as a task to begin immediately while OpenDJ directory server is online.

    $ restore -p 4444 -D "cn=Directory Manager" -w password
     -d /path/to/opendj/bak -I 20110613080032 -t 0
    Restore task 20110613155052932 scheduled to start Jun 13, 2011 3:50:52 PM CEST

The following example restores data while OpenDJ is offline.

    $ stop-ds
    Stopping Server...
    ...

    $ restore --backupDirectory /path/to/opendj/bak/userRoot \
     --listBackups
    Backup ID:          20120928102414Z
    Backup Date:        28/Sep/2012:12:24:17 +0200
    Is Incremental:     false
    Is Compressed:      false
    Is Encrypted:       false
    Has Unsigned Hash:  false
    Has Signed Hash:    false
    Dependent Upon:     none

    $ restore --backupDirectory /path/to/opendj/bak/userRoot \
     --backupID 20120928102414Z
    [28/Sep/2012:12:26:20 +0200] ... msg=Restored: 00000000.jdb (size 355179)

    $ start-ds
    [28/Sep/2012:12:27:29 +0200] ... The Directory Server has started successfully

Prev | Up | Next
rebuild-index | Home | setup