DS 7 introduces improvements to simplify replication and backup/restore. If you need to restore old backup data in DS 7 and later, you should refer to Configuration Guide › Restore to a Known State.
There are two types of backup data:
- A binary backup - created using the DS backup --backUpAll command.
- In LDIF format - created using the DS export-ldif command.
If you are restoring a binary backup, you must ensure that the backup file exists on the local server on which you want to run the restore command. You cannot restore a backup file from a remote instance.
You can restore old backup data to a DS replication topology and initialize replication as follows:
- Enter the following command on one of the servers (server1 for purposes of example) to prepare the domain on all servers for being externally initialized: You must specify the baseDN of the data you are going to be changing, for example, dc=example,dc=com. $ ./dsreplication pre-external-initialization --hostname ds1.example.com --port 4444 --baseDN dc=example,dc=com --adminUID admin --adminPassword password --no-prompt
- Restore the backup data to server1 as follows, depending on what type it is:
- Binary backup - run the restore command on server1, for example: $ ./restore --hostname ds1.example.com --port 4444 --bindDN "cn=Directory Manager" --bindPassword password --backupID 20161019100952Z --backupDirectory /path/to/ds/binaryBackup_bak
- LDIF format - use the import-ldif command, for example: $ ./import-ldif --hostname ds1.example.com --port 4444 --baseDN dc=example,dc=com --backendID userRoot --ldifFile /path/to/backupfile.ldif
- Back up server1 (which now includes your restored backup data) using the backup command, for example: $ ./backup --hostname ds1.example.com --port 4444 --bindDN "cn=Directory Manager" --bindPassword password --backendID userRoot --backupDirectory /path/to/ds/server1_bak --start 0
- Copy the backup file you created in the previous step and the accompanying backup.info file to each server you want to restore (server2 and server3 in this example).
- Restore this backup to all the other servers by running the restore command locally on each server in the topology, for example: $ server2/bin/restore --hostname ds2.example.com --port 4444 --bindDN "cn=Directory Manager" --bindPassword password --backupID 20161019102414Z --backupDirectory /path/to/ds/server1_bak $ server3/bin/restore --hostname ds3.example.com --port 4444 --bindDN "cn=Directory Manager" --bindPassword password --backupID 20161019102414Z --backupDirectory /path/to/ds/server1_bak [...]
- Enter the following command on server1 to set the new generation ID for the entire domain. Ensure you use the same baseDN as in step 1: $ ./dsreplication post-external-initialization --hostname ds1.example.com --port 4444 --baseDN dc=example,dc=com --adminUID admin --adminPassword password --no-prompt
Instead of backing up and restoring (steps 3 and 5), you could use the dsreplication initialize-all command to initialize all servers via the network. This command Initializes the contents of the data under the specified base DN on all the servers with the contents on the specified server. See Reference › dsreplication for further details.
The above steps alter the generation ID of the replicated domain. "Old" changes will not get replayed because they were targeting the data using the previous generation ID. The final step calculates a new generation ID for the domain and broadcasts it to all the servers, which allows them to replicate again.
Replication will now proceed as normal, but from the restored point in time.