blob: 9609469a305374f04594676bf122d0628b731226 [file] [log] [blame]
Title: 1.6. - Backup/Restore
NavPrev: 1.5-sample-configuration.html
NavprevText: 1.5 - About the sample configurations and sample directory data
NavUp: 1-how-to-begin.html
NavUpText: 1 - How to begin
NavNext: 2-handling-data.html
NavNextText: 2 - Handling data within your directory
Notice: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
# 1.6. - Backup/Restore
You may want to save your data in a safe place, and be able to restore them.
**ApacheDS** stores its data into a set of files, which are binary files. You can't simply copy those files in a backup directory, because there is no guarantee that their state is consistant when you do a copy (unless you have stopped the server while doing so) : one update operation might be running when you do a copy, and unless this update has been completed, the database is nt in a stable state.
The current solution is to extract a LDIF from ApacheDS. You can do so either by using Apache Directory Studio, or through a script using the slapsearch utility, on the partition you are interested in. In any case, you must requests all the attributes, including the operational attributes (use the '+' special attributes for that purpose). Here is a sample command line that extract the data from the 'example' partition, on a default ApacheDS install :
$ ldapsearch -D "uid=admin,ou=system" -w secret -p 10389 -h localhost -b "dc=example,dc=com" -s sub "(ObjectClass=*)" * + > backup.ldif
(note that you will have to change the password, port, server name and partition name to fits your setup)
Restoring the database is a matter of starting frm a blank partition, and reimport the LDIF.
Note : This is not really convenient. First, it requires that an external tool is present to run the extract. Second, reimporting a huge database will take a lot of time...
We are working on a new system that guarantees that the file containing the data can be copied directly and restored as is.