]> git.sur5r.net Git - openldap/blob - doc/man/man8/slapcat.8
happy belated New Year
[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 .TP
86 .BI \-d \ debug-level
87 Enable debugging messages as defined by the specified
88 .IR debug-level ;
89 see
90 .BR slapd (8)
91 for details.
92 .TP
93 .BI \-f \ slapd.conf
94 Specify an alternative
95 .BR slapd.conf (5)
96 file.
97 .TP
98 .BI \-F \ confdir
99 specify a config directory.
100 If both
101 .B \-f
102 and
103 .B \-F
104 are specified, the config file will be read and converted to
105 config directory format and written to the specified directory.
106 If neither option is specified, an attempt to read the
107 default config directory will be made before trying to use the default
108 config file. If a valid config directory exists then the
109 default config file is ignored.
110 .TP
111 .B \-g
112 disable subordinate gluing.  Only the specified database will be
113 processed, and not its glued subordinates (if any).
114 .TP
115 .B \-H \ URI
116 use dn, scope and filter from URI to only handle matching entries.
117 .TP
118 .BI \-l \ ldif-file
119 Write LDIF to specified file instead of standard output.
120 .TP
121 .BI \-n \ dbnum
122 Generate output for the \fIdbnum\fR-th database listed in the
123 configuration file. The config database
124 .BR slapd\-config (5),
125 is always the first database, so use
126 .B \-n 0
127 to select it.
128
129 The
130 .B \-n
131 cannot be used in conjunction with the
132 .B \-b
133 option.
134 .TP
135 .BI \-o \ option\fR[ = value\fR]
136 Specify an
137 .I option
138 with a(n optional)
139 .IR value .
140 Possible generic options/values are:
141 .LP
142 .nf
143               syslog=<subsystems>  (see `\-s' in slapd(8))
144               syslog\-level=<level> (see `\-S' in slapd(8))
145               syslog\-user=<user>   (see `\-l' in slapd(8))
146
147 .fi
148 .TP
149 .BI \-s \ subtree-dn
150 Only dump entries in the subtree specified by this DN.
151 Implies \fB\-b\fP \fIsubtree-dn\fP if no
152 .B \-b
153 or
154 .B \-n
155 option is given.
156 Deprecated; use \fB-H\fP \fIldap:///subtree-dn\fP instead.
157 .TP
158 .B \-v
159 Enable verbose mode.
160 .SH LIMITATIONS
161 For some backend types, your
162 .BR slapd (8)
163 should not be running (at least, not in read-write
164 mode) when you do this to ensure consistency of the database. It is
165 always safe to run 
166 .B slapcat
167 with the
168 .BR slapd\-bdb (5),
169 .BR slapd\-hdb (5),
170 and
171 .BR slapd\-null (5)
172 backends.
173 .SH EXAMPLES
174 To make a text backup of your SLAPD database and put it in a file called
175 .BR ldif ,
176 give the command:
177 .LP
178 .nf
179 .ft tt
180         SBINDIR/slapcat \-l ldif
181 .ft
182 .fi
183 .SH "SEE ALSO"
184 .BR ldap (3),
185 .BR ldif (5),
186 .BR slapadd (8),
187 .BR ldapadd (1),
188 .BR slapd (8)
189 .LP
190 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
191 .SH ACKNOWLEDGEMENTS
192 .so ../Project