8 **notmuch** **dump** [--format=(batch-tag|sup)] [--] [--output=<*file*>] [--] [<*search-term*> ...]
13 Dump tags for messages matching the given search terms.
15 Output is to the given filename, if any, or to stdout.
17 These tags are the only data in the notmuch database that can't be
18 recreated from the messages themselves. The output of notmuch dump is
19 therefore the only critical thing to backup (and much more friendly to
20 incremental backup than the native database files.)
23 Compress the output in a format compatible with **gzip(1)**.
25 ``--format=(sup|batch-tag)``
26 Notmuch restore supports two plain text dump formats, both with one
27 message-id per line, followed by a list of tags.
30 The default **batch-tag** dump format is intended to more robust
31 against malformed message-ids and tags containing whitespace or
32 non-\ **ascii(7)** characters. Each line has the form
34 +<*encoded-tag*\ > +<*encoded-tag*\ > ... --
35 id:<*quoted-message-id*\ >
37 Tags are hex-encoded by replacing every byte not matching the
38 regex **[A-Za-z0-9@=.,\_+-]** with **%nn** where nn is the two
39 digit hex encoding. The message ID is a valid Xapian query,
40 quoted using Xapian boolean term quoting rules: if the ID
41 contains whitespace or a close paren or starts with a double
42 quote, it must be enclosed in double quotes and double quotes
43 inside the ID must be doubled. The astute reader will notice
44 this is a special case of the batch input format for
45 **notmuch-tag(1)**; note that the single message-id query is
46 mandatory for **notmuch-restore(1)**.
49 The **sup** dump file format is specifically chosen to be
50 compatible with the format of files produced by sup-dump. So if
51 you've previously been using sup for mail, then the **notmuch
52 restore** command provides you a way to import all of your tags
53 (or labels as sup calls them). Each line has the following form
55 <*message-id*\ > **(** <*tag*\ > ... **)**
57 with zero or more tags are separated by spaces. Note that
58 (malformed) message-ids may contain arbitrary non-null
59 characters. Note also that tags with spaces will not be
60 correctly restored with this format.
62 With no search terms, a dump of all messages in the database will be
63 generated. A "--" argument instructs notmuch that the remaining
64 arguments are search terms.
66 See **notmuch-search-terms(7)** for details of the supported syntax
72 **notmuch(1)**, **notmuch-config(1)**, **notmuch-count(1)**,
73 **notmuch-hooks(5)**, **notmuch-insert(1)**, **notmuch-new(1)**,
74 **notmuch-reply(1)**, **notmuch-restore(1)**, **notmuch-search(1)**,
75 **notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**