1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-23 00:07:38 +00:00
borg/docs/man/borg-transfer.1

189 lines
6.8 KiB
Groff
Raw Normal View History

2022-06-23 23:19:19 +00:00
.\" 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
..
2024-10-31 19:50:06 +00:00
.TH "BORG-TRANSFER" 1 "2024-10-31" "" "borg backup tool"
2022-06-23 23:19:19 +00:00
.SH NAME
2022-07-03 23:21:50 +00:00
borg-transfer \- archives transfer from other repository, optionally upgrade data format
2022-06-23 23:19:19 +00:00
.SH SYNOPSIS
.sp
borg [common options] transfer [options]
.SH DESCRIPTION
.sp
This command transfers archives from one repository to another repository.
2022-07-03 23:21:50 +00:00
Optionally, it can also upgrade the transferred data.
2023-06-11 21:10:23 +00:00
Optionally, it can also recompress the transferred data.
.sp
It is easiest (and fastest) to give \fB\-\-compression=COMPRESSION \-\-recompress=never\fP using
the same COMPRESSION mode as in the SRC_REPO \- borg will use that COMPRESSION for metadata (in
any case) and keep data compressed \(dqas is\(dq (saves time as no data compression is needed).
.sp
If you want to globally change compression while transferring archives to the DST_REPO,
give \fB\-\-compress=WANTED_COMPRESSION \-\-recompress=always\fP\&.
2022-06-23 23:19:19 +00:00
.sp
2024-09-07 20:31:48 +00:00
The default is to transfer all archives.
.sp
You could use the misc. archive filter options to limit which archives it will
transfer, e.g. using the \fB\-a\fP option. This is recommended for big
repositories with multiple data sets to keep the runtime per invocation lower.
.SS General purpose archive transfer
.sp
Transfer borg2 archives into a related other borg2 repository:
2022-06-23 23:19:19 +00:00
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
2022-08-03 20:19:12 +00:00
# create a related DST_REPO (reusing key material from SRC_REPO), so that
2022-06-23 23:19:19 +00:00
# chunking and chunk id generation will work in the same way as before.
2024-09-08 15:52:10 +00:00
borg \-\-repo=DST_REPO repo\-create \-\-encryption=DST_ENC \-\-other\-repo=SRC_REPO
2022-06-23 23:19:19 +00:00
# transfer archives from SRC_REPO to DST_REPO
borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-dry\-run # check what it would do
borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO # do it!
borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-dry\-run # check! anything left?
.ft P
.fi
.UNINDENT
.UNINDENT
2024-09-07 20:31:48 +00:00
.SS Data migration / upgrade from borg 1.x
2022-06-23 23:19:19 +00:00
.sp
2024-09-07 20:31:48 +00:00
To migrate your borg 1.x archives into a related, new borg2 repository, usage is quite similar
to the above, but you need the \fB\-\-from\-borg1\fP option:
2022-07-03 23:21:50 +00:00
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
2024-09-08 15:52:10 +00:00
borg \-\-repo=DST_REPO repocreate \-\-encryption=DST_ENC \-\-other\-repo=SRC_REPO \-\-from\-borg1
2024-09-07 20:31:48 +00:00
# to continue using lz4 compression as you did in SRC_REPO:
borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-from\-borg1 \e
\-\-compress=lz4 \-\-recompress=never
2023-06-11 21:10:23 +00:00
2024-09-07 20:31:48 +00:00
# alternatively, to recompress everything to zstd,3:
borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-from\-borg1 \e
2023-06-11 21:10:23 +00:00
\-\-compress=zstd,3 \-\-recompress=always
2022-07-03 23:21:50 +00:00
.ft P
.fi
.UNINDENT
.UNINDENT
2022-06-23 23:19:19 +00:00
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
2024-07-19 18:40:15 +00:00
.SS optional arguments
2022-06-23 23:19:19 +00:00
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-dry\-run
do not change repository, just check
.TP
.BI \-\-other\-repo \ SRC_REPOSITORY
transfer archives from the other repository
2022-07-03 23:21:50 +00:00
.TP
2024-09-07 20:31:48 +00:00
.B \-\-from\-borg1
other repository is borg 1.x
.TP
2022-07-03 23:21:50 +00:00
.BI \-\-upgrader \ UPGRADER
use the upgrader to convert transferred data (default: no conversion)
2023-06-11 21:10:23 +00:00
.TP
.BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
.TP
.BI \-\-recompress \ MODE
recompress data chunks according to \fIMODE\fP and \fB\-\-compression\fP\&. Possible modes are \fIalways\fP: recompress unconditionally; and \fInever\fP: do not recompress (faster: re\-uses compressed data chunks w/o change).If no MODE is given, \fIalways\fP will be used. Not passing \-\-recompress is equivalent to \(dq\-\-recompress never\(dq.
2022-06-23 23:19:19 +00:00
.UNINDENT
.SS Archive filters
.INDENT 0.0
.TP
2022-10-02 13:51:17 +00:00
.BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
2024-10-03 10:23:03 +00:00
only consider archives matching all patterns. see \(dqborg help match\-archives\(dq.
2022-06-23 23:19:19 +00:00
.TP
.BI \-\-sort\-by \ KEYS
2024-10-03 10:23:03 +00:00
Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
2022-06-23 23:19:19 +00:00
.TP
.BI \-\-first \ N
consider first N archives after other filters were applied
.TP
.BI \-\-last \ N
consider last N archives after other filters were applied
2023-02-26 20:30:54 +00:00
.TP
.BI \-\-oldest \ TIMESPAN
consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
.TP
.BI \-\-newest \ TIMESPAN
consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g. 7d or 12m.
.TP
.BI \-\-older \ TIMESPAN
2024-02-20 16:12:43 +00:00
consider archives older than (now \- TIMESPAN), e.g. 7d or 12m.
2023-02-26 20:30:54 +00:00
.TP
.BI \-\-newer \ TIMESPAN
consider archives newer than (now \- TIMESPAN), e.g. 7d or 12m.
2022-06-23 23:19:19 +00:00
.UNINDENT
2022-06-26 11:56:33 +00:00
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
2022-06-26 11:56:33 +00:00
.sp
.nf
.ft C
# 0. Have borg 2.0 installed on client AND server, have a b12 repo copy for testing.
2022-09-10 14:03:27 +00:00
# 1. Create a new \(dqrelated\(dq repository:
2022-06-26 11:56:33 +00:00
# here, the existing borg 1.2 repo used repokey\-blake2 (and aes\-ctr mode),
# thus we use repokey\-blake2\-aes\-ocb for the new borg 2.0 repo.
# staying with the same chunk id algorithm (blake2) and with the same
# key material (via \-\-other\-repo <oldrepo>) will make deduplication work
# between old archives (copied with borg transfer) and future ones.
# the AEAD cipher does not matter (everything must be re\-encrypted and
# re\-authenticated anyway), you could also choose repokey\-blake2\-chacha20\-poly1305.
2022-09-10 14:03:27 +00:00
# in case your old borg repo did not use blake2, just remove the \(dq\-blake2\(dq.
2024-09-08 15:52:10 +00:00
$ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 repo\-create \e
\-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-e repokey\-blake2\-aes\-ocb
2022-06-26 11:56:33 +00:00
# 2. Check what and how much it would transfer:
2022-08-03 20:19:12 +00:00
$ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
\-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-\-dry\-run
2022-06-26 11:56:33 +00:00
# 3. Transfer (copy) archives from old repo into new repo (takes time and space!):
2022-08-03 20:19:12 +00:00
$ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
\-\-other\-repo ssh://borg2@borgbackup/./tests/b12
2022-06-26 11:56:33 +00:00
# 4. Check if we have everything (same as 2.):
2022-08-03 20:19:12 +00:00
$ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
\-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-\-dry\-run
.ft P
.fi
2022-06-26 11:56:33 +00:00
.UNINDENT
.UNINDENT
2022-06-23 23:19:19 +00:00
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.