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.)
22 ``--format=(sup|batch-tag)``
23 Notmuch restore supports two plain text dump formats, both with one
24 message-id per line, followed by a list of tags.
27 The default **batch-tag** dump format is intended to more robust
28 against malformed message-ids and tags containing whitespace or
29 non-\ **ascii(7)** characters. Each line has the form
31 +<*encoded-tag*\ > +<*encoded-tag*\ > ... --
32 id:<*quoted-message-id*\ >
34 Tags are hex-encoded by replacing every byte not matching the
35 regex **[A-Za-z0-9@=.,\_+-]** with **%nn** where nn is the two
36 digit hex encoding. The message ID is a valid Xapian query,
37 quoted using Xapian boolean term quoting rules: if the ID
38 contains whitespace or a close paren or starts with a double
39 quote, it must be enclosed in double quotes and double quotes
40 inside the ID must be doubled. The astute reader will notice
41 this is a special case of the batch input format for
42 **notmuch-tag(1)**; note that the single message-id query is
43 mandatory for **notmuch-restore(1)**.
46 The **sup** dump file format is specifically chosen to be
47 compatible with the format of files produced by sup-dump. So if
48 you've previously been using sup for mail, then the **notmuch
49 restore** command provides you a way to import all of your tags
50 (or labels as sup calls them). Each line has the following form
52 <*message-id*\ > **(** <*tag*\ > ... **)**
54 with zero or more tags are separated by spaces. Note that
55 (malformed) message-ids may contain arbitrary non-null
56 characters. Note also that tags with spaces will not be
57 correctly restored with this format.
59 With no search terms, a dump of all messages in the database will be
60 generated. A "--" argument instructs notmuch that the remaining
61 arguments are search terms.
63 See **notmuch-search-terms(7)** for details of the supported syntax
69 **notmuch(1)**, **notmuch-config(1)**, **notmuch-count(1)**,
70 **notmuch-hooks(5)**, **notmuch-insert(1)**, **notmuch-new(1)**,
71 **notmuch-reply(1)**, **notmuch-restore(1)**, **notmuch-search(1)**,
72 **notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**