.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "NOTMUCH-RESTORE" "1" "Mar 11, 2026" "0.40" "notmuch"
.SH NAME
notmuch-restore \- restores the tags from the given file (see notmuch dump)
.SH SYNOPSIS
.sp
\fBnotmuch\fP \fBrestore\fP [\-\-accumulate] [\-\-format=(auto|batch\-tag|sup)] [\-\-input=<\fIfilename\fP>]
.SH DESCRIPTION
.sp
Restores the tags from the given file (see \fI\%notmuch\-dump\fP).
.sp
The input is read from the given filename, if any, or from stdin.
.sp
Supported options for \fBrestore\fP include
.INDENT 0.0
.TP
.B \-\-accumulate
The union of the existing and new tags is applied, instead of
replacing each message\(aqs tags as they are read in from the dump
file.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-format=(sup|batch\-tag|auto)
Notmuch restore supports two plain text dump formats, with each
line specifying a message\-id and a set of tags. For details of the
actual formats, see \fI\%notmuch\-dump\fP\&.
.INDENT 7.0
.TP
.B sup
The \fBsup\fP dump file format is specifically chosen to be
compatible with the format of files produced by sup\-dump. So
if you\(aqve previously been using sup for mail, then the
\fBnotmuch restore\fP command provides you a way to import all
of your tags (or labels as sup calls them).
.TP
.B batch\-tag
The \fBbatch\-tag\fP dump format is intended to more robust
against malformed message\-ids and tags containing whitespace
or non\-\fBascii(7)\fP characters. See \fI\%notmuch\-dump\fP for
details on this format.
.sp
\fBnotmuch restore\fP updates the maildir flags according to tag
changes if the \fBmaildir.synchronize_flags\fP configuration
option is enabled. See \fI\%notmuch\-config\fP for details.
.TP
.B auto
This option (the default) tries to guess the format from the
input. For correctly formed input in either supported format,
this heuristic, based the fact that batch\-tag format contains
no parentheses, should be accurate.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-include=(config|properties|tags)
Control what kind of metadata is restored.
.INDENT 7.0
.TP
.B config
Restore configuration data to the database. Each configuration
line starts with \(dq#@ \(dq, followed by a space separated
key\-value pair.  Both key and value are hex encoded if needed.
.TP
.B properties
Restore per\-message (key,value) metadata.  Each line starts
with \(dq#= \(dq, followed by a message id, and a space separated
list of key=value pairs.  Ids, keys and values are hex encoded
if needed.  See \fI\%notmuch\-properties\fP for more details.
.TP
.B tags
Restore per\-message metadata, namely tags. See \fIformat\fP above
for more details.
.UNINDENT
.sp
The default is to restore all available types of data. The option
can be specified multiple times to select some subset.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-input=<filename>
Read input from given file instead of stdin.
.UNINDENT
.SH GZIPPED INPUT
.sp
\fBnotmuch restore\fP will detect if the input is compressed in
\fB\X'tty: link https://manpages.debian.org/gzip.1.html'\fI\%gzip(1)\fP\X'tty: link'\fP format and automatically decompress it while
reading. This detection does not depend on file naming and in
particular works for standard input.
.SH SEE ALSO
.sp
\fI\%notmuch\fP,
\fI\%notmuch\-config\fP,
\fI\%notmuch\-count\fP,
\fI\%notmuch\-dump\fP,
\fI\%notmuch\-hooks\fP,
\fI\%notmuch\-insert\fP,
\fI\%notmuch\-new\fP,
\fI\%notmuch\-properties\fP,
\fI\%notmuch\-reply\fP,
\fI\%notmuch\-search\fP,
\fI\%notmuch\-search\-terms\fP,
\fI\%notmuch\-show\fP,
\fI\%notmuch\-tag\fP
.SH AUTHOR
Carl Worth and many others
.SH COPYRIGHT
2009-2026, Carl Worth and many others
.\" Generated by docutils manpage writer.
.
