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