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