8 **notmuch** **dump** [--gzip] [--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 See **notmuch-search-terms(7)** for details of the supported syntax
23 for <search-terms>. With no search terms, a dump of all messages in
24 the database will be generated. A "--" argument instructs notmuch that
25 the remaining arguments are search terms.
27 Supported options for **dump** include
30 Compress the output in a format compatible with **gzip(1)**.
32 ``--format=(sup|batch-tag)``
33 Notmuch restore supports two plain text dump formats, both with one
34 message-id per line, followed by a list of tags.
38 The default **batch-tag** dump format is intended to more
39 robust against malformed message-ids and tags containing
40 whitespace or non-\ **ascii(7)** characters. Each line has
43 +<*encoded-tag*\ > +<*encoded-tag*\ > ... --
44 id:<*quoted-message-id*\ >
46 Tags are hex-encoded by replacing every byte not matching
47 the regex **[A-Za-z0-9@=.,\_+-]** with **%nn** where nn is
48 the two digit hex encoding. The message ID is a valid
49 Xapian query, quoted using Xapian boolean term quoting
50 rules: if the ID contains whitespace or a close paren or
51 starts with a double quote, it must be enclosed in double
52 quotes and double quotes inside the ID must be
53 doubled. The astute reader will notice this is a special
54 case of the batch input format for **notmuch-tag(1)**;
55 note that the single message-id query is mandatory for
56 **notmuch-restore(1)**.
60 The **sup** dump file format is specifically chosen to be
61 compatible with the format of files produced by
62 sup-dump. So if you've previously been using sup for mail,
63 then the **notmuch restore** command provides you a way to
64 import all of your tags (or labels as sup calls
65 them). Each line has the following form
67 <*message-id*\ > **(** <*tag*\ > ... **)**
69 with zero or more tags are separated by spaces. Note that
70 (malformed) message-ids may contain arbitrary non-null
71 characters. Note also that tags with spaces will not be
72 correctly restored with this format.
74 ``--include=(config|properties|tags)``
76 Control what kind of metadata is included in the output.
80 Output configuration data stored in the database. Each line
81 starts with "#@ ", followed by a space separated key-value
82 pair. Both key and value are hex encoded if needed.
86 Output per-message (key,value) metadata. Each line starts
87 with "#= ", followed by a message id, and a space separated
88 list of key=value pairs. Ids, keys and values are hex encoded
89 if needed. See **notmuch-properties(7)** for more details.
93 Output per-message boolean metadata, namely tags. See *format* above
94 for description of the output.
96 The default is to include all available types of data. The
97 option can be specified multiple times to select some subset. As
98 of version 3 of the dump format, there is a header line of the
102 | #notmuch-dump <*format*>:<*version*> <*included*>
104 where <*included*> is a comma separated list of the above
107 ``--output=``\ <filename>
108 Write output to given file instead of stdout.
114 **notmuch-config(1)**,
115 **notmuch-count(1)**,
116 **notmuch-hooks(5)**,
117 **notmuch-insert(1)**,
119 **notmuch-properties(7)**,
120 **notmuch-reply(1)**,
121 **notmuch-restore(1)**,
122 **notmuch-search(1)**,
123 **notmuch-search-terms(7)**,