1NOTMUCH-DUMP(1) notmuch NOTMUCH-DUMP(1)
2
3
4
6 notmuch-dump - creates a plain-text dump of the tags of each message
7
9 notmuch dump [--gzip] [--format=(batch-tag|sup)] [--output=<file>] [--]
10 [<search-term> ...]
11
13 Dump tags for messages matching the given search terms.
14
15 Output is to the given filename, if any, or to stdout.
16
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.)
21
22 See notmuch-search-terms(7) for details of the supported syntax for
23 <search-terms>. With no search terms, a dump of all messages in the
24 database will be generated. A -- argument instructs notmuch that the
25 remaining arguments are search terms.
26
27 Supported options for dump include
28
29 --gzip Compress the output in a format compatible with gzip(1).
30
31 --format=(sup|batch-tag)
32 Notmuch restore supports two plain text dump formats, both with
33 one message-id per line, followed by a list of tags.
34
35 batch-tag
36 The default batch-tag dump format is intended to more
37 robust against malformed message-ids and tags containing
38 whitespace or non-ascii(7) characters. Each line has the
39 form:
40
41 +<*encoded-tag*\ > +<*encoded-tag*\ > ... -- id:<*quoted-message-id*\ >
42
43 Tags are hex-encoded by replacing every byte not matching
44 the regex [A-Za-z0-9@=.,_+-] with %nn where nn is the two
45 digit hex encoding. The message ID is a valid Xapian
46 query, quoted using Xapian boolean term quoting rules: if
47 the ID contains whitespace or a close paren or starts
48 with a double quote, it must be enclosed in double quotes
49 and double quotes inside the ID must be doubled. The
50 astute reader will notice this is a special case of the
51 batch input format for notmuch-tag(1); note that the sin‐
52 gle message-id query is mandatory for notmuch-restore(1).
53
54 sup The sup dump file format is specifically chosen to be
55 compatible with the format of files produced by sup-dump.
56 So if you've previously been using sup for mail, then the
57 notmuch restore command provides you a way to import all
58 of your tags (or labels as sup calls them). Each line has
59 the following form:
60
61 <*message-id*\ > **(** <*tag*\ > ... **)**
62
63 with zero or more tags are separated by spaces. Note that
64 (malformed) message-ids may contain arbitrary non-null
65 characters. Note also that tags with spaces will not be
66 correctly restored with this format.
67
68 --include=(config|properties|tags)
69 Control what kind of metadata is included in the output.
70
71 config Output configuration data stored in the database. Each
72 line starts with "#@ ", followed by a space separated
73 key-value pair. Both key and value are hex encoded if
74 needed.
75
76 properties
77 Output per-message (key,value) metadata. Each line
78 starts with "#= ", followed by a message id, and a space
79 separated list of key=value pairs. Ids, keys and values
80 are hex encoded if needed. See notmuch-properties(7) for
81 more details.
82
83 tags Output per-message boolean metadata, namely tags. See
84 format above for description of the output.
85
86 The default is to include all available types of data. The
87 option can be specified multiple times to select some subset. As
88 of version 3 of the dump format, there is a header line of the
89 following form:
90
91 #notmuch-dump <*format*>:<*version*> <*included*>
92
93 where <included> is a comma separated list of the above options.
94
95 --output=<filename>
96 Write output to given file instead of stdout.
97
99 notmuch(1), notmuch-config(1), notmuch-count(1), notmuch-hooks(5), not‐
100 much-insert(1), notmuch-new(1), notmuch-properties(7), not‐
101 much-reply(1), notmuch-restore(1), notmuch-search(1), not‐
102 much-search-terms(7), notmuch-show(1), notmuch-tag(1)
103
105 Carl Worth and many others
106
108 2009-2019, Carl Worth and many others
109
110
111
112
1130.28.4 May 06, 2019 NOTMUCH-DUMP(1)