10 **notmuch** **dump** [--gzip] [--format=(batch-tag|sup)] [--output=<*file*>] [--] [<*search-term*> ...]
15 Dump tags for messages matching the given search terms.
17 Output is to the given filename, if any, or to stdout.
19 These tags are the only data in the notmuch database that can't be
20 recreated from the messages themselves. The output of notmuch dump is
21 therefore the only critical thing to backup (and much more friendly to
22 incremental backup than the native database files.)
24 See :any:`notmuch-search-terms(7)` for details of the supported syntax
25 for <search-terms>. With no search terms, a dump of all messages in
26 the database will be generated. A ``--`` argument instructs notmuch that
27 the remaining arguments are search terms.
29 Supported options for **dump** include
32 Compress the output in a format compatible with :manpage:`gzip(1)`.
34 ``--format=(sup|batch-tag)``
35 Notmuch restore supports two plain text dump formats, both with
36 one message-id per line, followed by a list of tags.
39 The default **batch-tag** dump format is intended to more
40 robust against malformed message-ids and tags containing
41 whitespace or non-\ :manpage:`ascii(7)` characters. Each line
44 +<*encoded-tag*\ > +<*encoded-tag*\ > ... -- id:<*quoted-message-id*\ >
46 Tags are hex-encoded by replacing every byte not matching the
47 regex **[A-Za-z0-9@=.,\_+-]** with **%nn** where nn is the two
48 digit hex encoding. The message ID is a valid Xapian query,
49 quoted using Xapian boolean term quoting rules: if the ID
50 contains whitespace or a close paren or starts with a double
51 quote, it must be enclosed in double quotes and double quotes
52 inside the ID must be doubled. The astute reader will notice
53 this is a special case of the batch input format for
54 :any:`notmuch-tag(1)`; note that the single message-id query is
55 mandatory for :any:`notmuch-restore(1)`.
58 The **sup** dump file format is specifically chosen to be
59 compatible with the format of files produced by
60 :manpage:`sup-dump(1)`. So if you've previously been using sup
61 for mail, then the :any:`notmuch-restore(1)` command provides
62 you a way to import all of your tags (or labels as sup calls
63 them). Each line has the following form::
65 <*message-id*\ > **(** <*tag*\ > ... **)**
67 with zero or more tags are separated by spaces. Note that
68 (malformed) message-ids may contain arbitrary non-null
69 characters. Note also that tags with spaces will not be
70 correctly restored with this format.
72 ``--include=(config|properties|tags)``
73 Control what kind of metadata is included in the output.
76 Output configuration data stored in the database. Each line
77 starts with "#@ ", followed by a space separated key-value
78 pair. Both key and value are hex encoded if needed.
81 Output per-message (key,value) metadata. Each line starts
82 with "#= ", followed by a message id, and a space separated
83 list of key=value pairs. Ids, keys and values are hex encoded
84 if needed. See :any:`notmuch-properties(7)` for more details.
87 Output per-message boolean metadata, namely tags. See *format* above
88 for description of the output.
90 The default is to include all available types of data. The option
91 can be specified multiple times to select some subset. As of
92 version 3 of the dump format, there is a header line of the
95 #notmuch-dump <*format*>:<*version*> <*included*>
97 where <*included*> is a comma separated list of the above options.
99 ``--output=``\ <filename>
100 Write output to given file instead of stdout.
106 :any:`notmuch-config(1)`,
107 :any:`notmuch-count(1)`,
108 :any:`notmuch-hooks(5)`,
109 :any:`notmuch-insert(1)`,
110 :any:`notmuch-new(1)`,
111 :any:`notmuch-properties(7)`,
112 :any:`notmuch-reply(1)`,
113 :any:`notmuch-restore(1)`,
114 :any:`notmuch-search(1)`,
115 :any:`notmuch-search-terms(7)`,
116 :any:`notmuch-show(1)`,
117 :any:`notmuch-tag(1)`