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