]> git.sur5r.net Git - openldap/blob - doc/man/man8/slapcat.8
ITS#6258
[openldap] / doc / man / man8 / slapcat.8
1 .TH SLAPCAT 8C "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2009 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapcat \- SLAPD database to LDIF utility
7 .SH SYNOPSIS
8 .B SBINDIR/slapcat
9 [\c
10 .BI \-a filter\fR]
11 [\c
12 .BI \-b suffix\fR]
13 [\c
14 .BR \-c ]
15 [\c
16 .BI \-d debug-level\fR]
17 [\c
18 .BI \-f slapd.conf\fR]
19 [\c
20 .BI \-F confdir\fR]
21 [\c
22 .BR \-g ]
23 [\c
24 .BI \-l ldif-file\fR]
25 [\c
26 .BI \-n dbnum\fR]
27 [\c
28 .BI \-o option\fR[ = value\fR]]
29 [\c
30 .BI \-s subtree-dn\fR]
31 [\c
32 .BR \-v ]
33 .LP
34 .SH DESCRIPTION
35 .LP
36 .B Slapcat
37 is used to generate an LDAP Directory Interchange Format
38 (LDIF) output based upon the contents of a
39 .BR slapd (8)
40 database.
41 It opens the given database determined by the database number or
42 suffix and writes the corresponding LDIF to standard output or
43 the specified file.
44 Databases configured as
45 .B subordinate
46 of this one are also output, unless \fB\-g\fP is specified.
47 .LP
48 The entry records are presented in database order, not superior first
49 order.  The entry records will include all (user and operational)
50 attributes stored in the database.  The entry records will not include
51 dynamically generated attributes (such as subschemaSubentry).
52 .LP
53 The output of slapcat is intended to be used as input to
54 .BR slapadd (8).
55 The output of slapcat cannot generally be used as input to
56 .BR ldapadd (1)
57 or other LDAP clients without first editing the output.
58 This editing would normally include reordering the records
59 into superior first order and removing no-user-modification
60 operational attributes.
61 .SH OPTIONS
62 .TP
63 .BI \-a \ filter
64 Only dump entries matching the asserted filter.
65 For example
66
67 slapcat \-a \\
68     "(!(entryDN:dnSubtreeMatch:=ou=People,dc=example,dc=com))"
69
70 will dump all but the "ou=People,dc=example,dc=com" subtree
71 of the "dc=example,dc=com" database.
72 .TP
73 .BI \-b \ suffix 
74 Use the specified \fIsuffix\fR to determine which database to
75 generate output for.  The \fB\-b\fP cannot be used in conjunction
76 with the
77 .B \-n
78 option.
79 .TP
80 .B \-c
81 Enable continue (ignore errors) mode.
82 .TP
83 .BI \-d \ debug-level
84 Enable debugging messages as defined by the specified
85 .IR debug-level ;
86 see
87 .BR slapd (8)
88 for details.
89 .TP
90 .BI \-f \ slapd.conf
91 Specify an alternative
92 .BR slapd.conf (5)
93 file.
94 .TP
95 .BI \-F \ confdir
96 specify a config directory.
97 If both
98 .B \-f
99 and
100 .B \-F
101 are specified, the config file will be read and converted to
102 config directory format and written to the specified directory.
103 If neither option is specified, an attempt to read the
104 default config directory will be made before trying to use the default
105 config file. If a valid config directory exists then the
106 default config file is ignored.
107 .TP
108 .B \-g
109 disable subordinate gluing.  Only the specified database will be
110 processed, and not its glued subordinates (if any).
111 .TP
112 .BI \-l \ ldif-file
113 Write LDIF to specified file instead of standard output.
114 .TP
115 .BI \-n \ dbnum
116 Generate output for the \fIdbnum\fR-th database listed in the
117 configuration file. The config database
118 .BR slapd\-config (5),
119 is always the first database, so use
120 .B \-n 0
121 to select it.
122
123 The
124 .B \-n
125 cannot be used in conjunction with the
126 .B \-b
127 option.
128 .TP
129 .BI \-o \ option\fR[ = value\fR]
130 Specify an
131 .I option
132 with a(n optional)
133 .IR value .
134 Possible generic options/values are:
135 .LP
136 .nf
137               syslog=<subsystems>  (see `\-s' in slapd(8))
138               syslog\-level=<level> (see `\-S' in slapd(8))
139               syslog\-user=<user>   (see `\-l' in slapd(8))
140
141 .fi
142 .TP
143 .BI \-s \ subtree-dn
144 Only dump entries in the subtree specified by this DN.
145 Implies \fB\-b\fP \fIsubtree-dn\fP if no
146 .B \-b
147 or
148 .B \-n
149 option is given.
150 .TP
151 .B \-v
152 Enable verbose mode.
153 .SH LIMITATIONS
154 For some backend types, your
155 .BR slapd (8)
156 should not be running (at least, not in read-write
157 mode) when you do this to ensure consistency of the database. It is
158 always safe to run 
159 .B slapcat
160 with the
161 .BR slapd\-bdb (5),
162 .BR slapd\-hdb (5),
163 and
164 .BR slapd\-null (5)
165 backends.
166 .SH EXAMPLES
167 To make a text backup of your SLAPD database and put it in a file called
168 .BR ldif ,
169 give the command:
170 .LP
171 .nf
172 .ft tt
173         SBINDIR/slapcat \-l ldif
174 .ft
175 .fi
176 .SH "SEE ALSO"
177 .BR ldap (3),
178 .BR ldif (5),
179 .BR slapadd (8),
180 .BR ldapadd (1),
181 .BR slapd (8)
182 .LP
183 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
184 .SH ACKNOWLEDGEMENTS
185 .so ../Project