]> git.sur5r.net Git - openldap/blob - doc/man/man8/slapcat.8
Happy new year (belated)
[openldap] / doc / man / man8 / slapcat.8
1 .TH SLAPCAT 8C "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2014 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 76).
157 Use \fIno\fP for no wrap.
158 .TP
159 .BI \-s \ subtree-dn
160 Only dump entries in the subtree specified by this DN.
161 Implies \fB\-b\fP \fIsubtree-dn\fP if no
162 .B \-b
163 or
164 .B \-n
165 option is given.
166 Deprecated; use \fB-H\fP \fIldap:///subtree-dn\fP instead.
167 .TP
168 .B \-v
169 Enable verbose mode.
170 .SH LIMITATIONS
171 For some backend types, your
172 .BR slapd (8)
173 should not be running (at least, not in read-write
174 mode) when you do this to ensure consistency of the database. It is
175 always safe to run 
176 .B slapcat
177 with the
178 .BR slapd\-bdb (5),
179 .BR slapd\-hdb (5),
180 and
181 .BR slapd\-null (5)
182 backends.
183 .SH EXAMPLES
184 To make a text backup of your SLAPD database and put it in a file called
185 .BR ldif ,
186 give the command:
187 .LP
188 .nf
189 .ft tt
190         SBINDIR/slapcat \-l ldif
191 .ft
192 .fi
193 .SH "SEE ALSO"
194 .BR ldap (3),
195 .BR ldif (5),
196 .BR slapadd (8),
197 .BR ldapadd (1),
198 .BR slapd (8)
199 .LP
200 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
201 .SH ACKNOWLEDGEMENTS
202 .so ../Project