slapcat.8 4.78 KB
Newer Older
1
.TH SLAPCAT 8C "RELEASEDATE" "OpenLDAP LDVERSION"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
2
.\" Copyright 1998-2014 The OpenLDAP Foundation All Rights Reserved.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
3
.\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
4
.\" $OpenLDAP$
5
6
7
8
.SH NAME
slapcat \- SLAPD database to LDIF utility
.SH SYNOPSIS
.B SBINDIR/slapcat
Howard Chu's avatar
Howard Chu committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[\c
.BI \-a filter\fR]
[\c
.BI \-b suffix\fR]
[\c
.BR \-c ]
[\c
.BI \-d debug-level\fR]
[\c
.BI \-f slapd.conf\fR]
[\c
.BI \-F confdir\fR]
[\c
.BR \-g ]
[\c
24
25
.BI \-H URI\fR]
[\c
Howard Chu's avatar
Howard Chu committed
26
27
28
29
30
31
32
33
34
.BI \-l ldif-file\fR]
[\c
.BI \-n dbnum\fR]
[\c
.BI \-o option\fR[ = value\fR]]
[\c
.BI \-s subtree-dn\fR]
[\c
.BR \-v ]
35
36
37
38
39
40
41
42
43
.LP
.SH DESCRIPTION
.LP
.B Slapcat
is used to generate an LDAP Directory Interchange Format
(LDIF) output based upon the contents of a
.BR slapd (8)
database.
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
47
Databases configured as
.B subordinate
Howard Chu's avatar
Howard Chu committed
48
of this one are also output, unless \fB\-g\fP is specified.
49
.LP
50
51
52
53
54
55
The entry records are presented in database order, not superior first
order.  The entry records will include all (user and operational)
attributes stored in the database.  The entry records will not include
dynamically generated attributes (such as subschemaSubentry).
.LP
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
Hallvard Furuseth's avatar
Hallvard Furuseth committed
58
.BR ldapadd (1)
59
60
61
62
or other LDAP clients without first editing the output.
This editing would normally include reordering the records
into superior first order and removing no-user-modification
operational attributes.
63
64
.SH OPTIONS
.TP
Howard Chu's avatar
Howard Chu committed
65
.BI \-a \ filter
66
67
68
Only dump entries matching the asserted filter.
For example

Howard Chu's avatar
Howard Chu committed
69
slapcat \-a \\
70
71
72
73
    "(!(entryDN:dnSubtreeMatch:=ou=People,dc=example,dc=com))"

will dump all but the "ou=People,dc=example,dc=com" subtree
of the "dc=example,dc=com" database.
74
Deprecated; use \fB-H\fP \fIldap:///???(filter)\fP instead.
75
.TP
Howard Chu's avatar
Howard Chu committed
76
.BI \-b \ suffix 
Pierangelo Masarati's avatar
Pierangelo Masarati committed
77
Use the specified \fIsuffix\fR to determine which database to
Howard Chu's avatar
Howard Chu committed
78
generate output for.  The \fB\-b\fP cannot be used in conjunction
Pierangelo Masarati's avatar
Pierangelo Masarati committed
79
with the
80
.B \-n
Pierangelo Masarati's avatar
Pierangelo Masarati committed
81
82
83
84
option.
.TP
.B \-c
Enable continue (ignore errors) mode.
85
86
87
88
89
Multiple occorrences of
.B \-c
make
.BR slapcat (8)
try harder.
Pierangelo Masarati's avatar
Pierangelo Masarati committed
90
.TP
Howard Chu's avatar
Howard Chu committed
91
.BI \-d \ debug-level
Pierangelo Masarati's avatar
Pierangelo Masarati committed
92
Enable debugging messages as defined by the specified
Howard Chu's avatar
Howard Chu committed
93
.IR debug-level ;
94
95
96
see
.BR slapd (8)
for details.
97
.TP
Howard Chu's avatar
Howard Chu committed
98
.BI \-f \ slapd.conf
99
Specify an alternative
100
101
102
.BR slapd.conf (5)
file.
.TP
Howard Chu's avatar
Howard Chu committed
103
.BI \-F \ confdir
104
105
specify a config directory.
If both
Howard Chu's avatar
Howard Chu committed
106
.B \-f
107
and
Howard Chu's avatar
Howard Chu committed
108
.B \-F
109
110
111
are specified, the config file will be read and converted to
config directory format and written to the specified directory.
If neither option is specified, an attempt to read the
Howard Chu's avatar
Howard Chu committed
112
default config directory will be made before trying to use the default
113
114
115
config file. If a valid config directory exists then the
default config file is ignored.
.TP
Pierangelo Masarati's avatar
Pierangelo Masarati committed
116
117
118
119
.B \-g
disable subordinate gluing.  Only the specified database will be
processed, and not its glued subordinates (if any).
.TP
120
121
122
.B \-H \ URI
use dn, scope and filter from URI to only handle matching entries.
.TP
Howard Chu's avatar
Howard Chu committed
123
.BI \-l \ ldif-file
124
Write LDIF to specified file instead of standard output.
Pierangelo Masarati's avatar
Pierangelo Masarati committed
125
.TP
Howard Chu's avatar
Howard Chu committed
126
127
.BI \-n \ dbnum
Generate output for the \fIdbnum\fR-th database listed in the
128
configuration file. The config database
Howard Chu's avatar
Howard Chu committed
129
.BR slapd\-config (5),
130
131
is always the first database, so use
.B \-n 0
132
to select it.
133
134

The
Pierangelo Masarati's avatar
Pierangelo Masarati committed
135
136
137
138
139
.B \-n
cannot be used in conjunction with the
.B \-b
option.
.TP
Howard Chu's avatar
Howard Chu committed
140
.BI \-o \ option\fR[ = value\fR]
Pierangelo Masarati's avatar
Pierangelo Masarati committed
141
Specify an
Howard Chu's avatar
Howard Chu committed
142
.I option
Pierangelo Masarati's avatar
Pierangelo Masarati committed
143
with a(n optional)
Howard Chu's avatar
Howard Chu committed
144
.IR value .
Pierangelo Masarati's avatar
Pierangelo Masarati committed
145
146
147
148
Possible generic options/values are:
.LP
.nf
              syslog=<subsystems>  (see `\-s' in slapd(8))
Howard Chu's avatar
Howard Chu committed
149
150
              syslog\-level=<level> (see `\-S' in slapd(8))
              syslog\-user=<user>   (see `\-l' in slapd(8))
Pierangelo Masarati's avatar
Pierangelo Masarati committed
151

152
153
154
155
              ldif-wrap={no|<n>}

.in
\fIn\fP is the number of columns allowed for the LDIF output
Howard Chu's avatar
Howard Chu committed
156
157
158
(\fIn\fP equal to \fI0\fP uses the default, corresponding to 78).
The minimum is 2, leaving space for one character and one
continuation character.
159
Use \fIno\fP for no wrap.
Pierangelo Masarati's avatar
Pierangelo Masarati committed
160
.TP
Howard Chu's avatar
Howard Chu committed
161
.BI \-s \ subtree-dn
Pierangelo Masarati's avatar
Pierangelo Masarati committed
162
Only dump entries in the subtree specified by this DN.
Howard Chu's avatar
Howard Chu committed
163
Implies \fB\-b\fP \fIsubtree-dn\fP if no
Pierangelo Masarati's avatar
Pierangelo Masarati committed
164
165
166
167
.B \-b
or
.B \-n
option is given.
168
Deprecated; use \fB-H\fP \fIldap:///subtree-dn\fP instead.
Pierangelo Masarati's avatar
Pierangelo Masarati committed
169
170
171
.TP
.B \-v
Enable verbose mode.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
172
.SH LIMITATIONS
173
For some backend types, your
174
175
.BR slapd (8)
should not be running (at least, not in read-write
176
177
178
179
mode) when you do this to ensure consistency of the database. It is
always safe to run 
.B slapcat
with the
Howard Chu's avatar
Howard Chu committed
180
181
.BR slapd\-bdb (5),
.BR slapd\-hdb (5),
182
and
Howard Chu's avatar
Howard Chu committed
183
.BR slapd\-null (5)
184
backends.
185
186
187
188
189
190
191
.SH EXAMPLES
To make a text backup of your SLAPD database and put it in a file called
.BR ldif ,
give the command:
.LP
.nf
.ft tt
Howard Chu's avatar
Howard Chu committed
192
	SBINDIR/slapcat \-l ldif
193
194
195
196
197
198
199
200
.ft
.fi
.SH "SEE ALSO"
.BR ldap (3),
.BR ldif (5),
.BR slapadd (8),
.BR ldapadd (1),
.BR slapd (8)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
201
.LP
202
"OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
203
.SH ACKNOWLEDGEMENTS
204
.so ../Project