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
34 one message-id per line, followed by a list of tags.
37 The default **batch-tag** dump format is intended to more
38 robust against malformed message-ids and tags containing
39 whitespace or non-\ **ascii(7)** characters. Each line has the
42 +<*encoded-tag*\ > +<*encoded-tag*\ > ... -- id:<*quoted-message-id*\ >
44 Tags are hex-encoded by replacing every byte not matching the
45 regex **[A-Za-z0-9@=.,\_+-]** with **%nn** where nn is the two
46 digit hex encoding. The message ID is a valid Xapian query,
47 quoted using Xapian boolean term quoting rules: if the ID
48 contains whitespace or a close paren or starts with a double
49 quote, it must be enclosed in double quotes and double quotes
50 inside the ID must be doubled. The astute reader will notice
51 this is a special case of the batch input format for
52 **notmuch-tag(1)**; note that the single message-id query is
53 mandatory for **notmuch-restore(1)**.
56 The **sup** dump file format is specifically chosen to be
57 compatible with the format of files produced by sup-dump. So
58 if you've previously been using sup for mail, then the
59 **notmuch restore** command provides you a way to import all
60 of your tags (or labels as sup calls them). Each line has the
63 <*message-id*\ > **(** <*tag*\ > ... **)**
65 with zero or more tags are separated by spaces. Note that
66 (malformed) message-ids may contain arbitrary non-null
67 characters. Note also that tags with spaces will not be
68 correctly restored with this format.
70 ``--include=(config|properties|tags)``
71 Control what kind of metadata is included in the output.
74 Output configuration data stored in the database. Each line
75 starts with "#@ ", followed by a space separated key-value
76 pair. Both key and value are hex encoded if needed.
79 Output per-message (key,value) metadata. Each line starts
80 with "#= ", followed by a message id, and a space separated
81 list of key=value pairs. Ids, keys and values are hex encoded
82 if needed. See **notmuch-properties(7)** for more details.
85 Output per-message boolean metadata, namely tags. See *format* above
86 for description of the output.
88 The default is to include all available types of data. The option
89 can be specified multiple times to select some subset. As of
90 version 3 of the dump format, there is a header line of the
93 #notmuch-dump <*format*>:<*version*> <*included*>
95 where <*included*> is a comma separated list of the above options.
97 ``--output=``\ <filename>
98 Write output to given file instead of stdout.
104 **notmuch-config(1)**,
105 **notmuch-count(1)**,
106 **notmuch-hooks(5)**,
107 **notmuch-insert(1)**,
109 **notmuch-properties(7)**,
110 **notmuch-reply(1)**,
111 **notmuch-restore(1)**,
112 **notmuch-search(1)**,
113 **notmuch-search-terms(7)**,