Sun Java System Directory Server Enterprise Edition 6.3 Evaluation Guide

Synchronized Backup and Export

All offline and online backup methods can be invoked in the CLI by using dsadm or dsconf. The default behavior for these commands is to operate in synchronous mode. The commands do not return a completion code until the task is complete.

You can use the dsconf import, dsconf export, dsconf backup, and dsconf restorecommands in an asynchronous mode by setting the -a flag.

Online Binary Backup

You can perform an online binary backup with dsconf or by using the Directory Service Control Center (DSCC).

For example, to back up master sA1 and store the resulting binary backup in the /install-path/sA1-bak directory, run the following command:


$ dsconf backup -p 20390 install-path/sA1-bak

Use the -a or --async option to start a backup task that returns immediately.

Online LDIF Export

You can perform an online LDIF export using the command line or using the DSCC. For example, use the following command to export to a file called export.ldif:


$ dsconf export -p 20390 "dc=example,dc=com" install-path/export.ldif
Beginning export of 'example'
example: Processed 8 entries (100%).
Export finished.

Task completed (slapd exit code: 0).

Offline Binary Backup

You can perform an offline binary backup with the dsadm backup command. The instance must be stopped before running this command.

The following command performs an offline binary backup:


$ dsadm backup install-path/sA1 install-path/sA1-bak
[28/Oct/2006:23:38:13 -0500] - Backup starting (install-path/sA1-bak)
[28/Oct/2006:23:38:13 -0500] - WARNING<20509> - Backend Database - conn=-1 op=-1
 msgId=-1 - Cannot create new directory install-path/sA1-bak/dsA1 (-5943)
 Cannot create or rename a filename that already exists.
[28/Oct/2006:23:38:13 -0500] - Backing up file 1
 (install-path/sA1-bak/dsA1/dsA1_objectclass.db3)
[28/Oct/2006:23:38:13 -0500] - Backing up file 2
 (install-path/sA1-bak/dsA1/dsA1_id2entry.db3)
[28/Oct/2005:23:38:13 -0500] - Backup completed (install-path/sA1-bak)

Offline LDIF Export

You can perform an offline LDIF export using the dsadm export command as follows:


$ dsadm export install-path/sA1 "dc=example,dc=com" install-path/export.ldif
Exporting data...
[28/Oct/2005:23:37:46 -0500] - DEBUG - conn=-1 op=-1 msgId=-1 -  Backend Instance: dsA1
 ldiffile: install-path/export.ldif
[28/Oct/2005:23:37:46 -0500] - export dsA1: Processed 8 entries (100%).

Binary Restore Methods

The dsadm and dsconf commands can also be used to restore data. The commands are used the same way as for backups except that the commands used are dsadm restore and dsconf restore. The instance must be stopped before running this command.