borg-transfer.1 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "BORG-TRANSFER" 1 "2023-09-14" "" "borg backup tool"
  31. .SH NAME
  32. borg-transfer \- archives transfer from other repository, optionally upgrade data format
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] transfer [options]
  36. .SH DESCRIPTION
  37. .sp
  38. This command transfers archives from one repository to another repository.
  39. Optionally, it can also upgrade the transferred data.
  40. Optionally, it can also recompress the transferred data.
  41. .sp
  42. It is easiest (and fastest) to give \fB\-\-compression=COMPRESSION \-\-recompress=never\fP using
  43. the same COMPRESSION mode as in the SRC_REPO \- borg will use that COMPRESSION for metadata (in
  44. any case) and keep data compressed \(dqas is\(dq (saves time as no data compression is needed).
  45. .sp
  46. If you want to globally change compression while transferring archives to the DST_REPO,
  47. give \fB\-\-compress=WANTED_COMPRESSION \-\-recompress=always\fP\&.
  48. .sp
  49. Suggested use for general purpose archive transfer (not repo upgrades):
  50. .INDENT 0.0
  51. .INDENT 3.5
  52. .sp
  53. .nf
  54. .ft C
  55. # create a related DST_REPO (reusing key material from SRC_REPO), so that
  56. # chunking and chunk id generation will work in the same way as before.
  57. borg \-\-repo=DST_REPO rcreate \-\-other\-repo=SRC_REPO \-\-encryption=DST_ENC
  58. # transfer archives from SRC_REPO to DST_REPO
  59. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-dry\-run # check what it would do
  60. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO # do it!
  61. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-dry\-run # check! anything left?
  62. .ft P
  63. .fi
  64. .UNINDENT
  65. .UNINDENT
  66. .sp
  67. The default is to transfer all archives, including checkpoint archives.
  68. .sp
  69. You could use the misc. archive filter options to limit which archives it will
  70. transfer, e.g. using the \fB\-a\fP option. This is recommended for big
  71. repositories with multiple data sets to keep the runtime per invocation lower.
  72. .sp
  73. For repository upgrades (e.g. from a borg 1.2 repo to a related borg 2.0 repo), usage is
  74. quite similar to the above:
  75. .INDENT 0.0
  76. .INDENT 3.5
  77. .sp
  78. .nf
  79. .ft C
  80. # fast: compress metadata with zstd,3, but keep data chunks compressed as they are:
  81. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-upgrader=From12To20 \e
  82. \-\-compress=zstd,3 \-\-recompress=never
  83. # compress metadata and recompress data with zstd,3
  84. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-upgrader=From12To20 \e
  85. \-\-compress=zstd,3 \-\-recompress=always
  86. .ft P
  87. .fi
  88. .UNINDENT
  89. .UNINDENT
  90. .SH OPTIONS
  91. .sp
  92. See \fIborg\-common(1)\fP for common options of Borg commands.
  93. .SS options
  94. .INDENT 0.0
  95. .TP
  96. .B \-n\fP,\fB \-\-dry\-run
  97. do not change repository, just check
  98. .TP
  99. .BI \-\-other\-repo \ SRC_REPOSITORY
  100. transfer archives from the other repository
  101. .TP
  102. .BI \-\-upgrader \ UPGRADER
  103. use the upgrader to convert transferred data (default: no conversion)
  104. .TP
  105. .BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
  106. select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
  107. .TP
  108. .BI \-\-recompress \ MODE
  109. 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.
  110. .UNINDENT
  111. .SS Archive filters
  112. .INDENT 0.0
  113. .TP
  114. .BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
  115. only consider archive names matching the pattern. see \(dqborg help match\-archives\(dq.
  116. .TP
  117. .BI \-\-sort\-by \ KEYS
  118. Comma\-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
  119. .TP
  120. .BI \-\-first \ N
  121. consider first N archives after other filters were applied
  122. .TP
  123. .BI \-\-last \ N
  124. consider last N archives after other filters were applied
  125. .TP
  126. .BI \-\-oldest \ TIMESPAN
  127. consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
  128. .TP
  129. .BI \-\-newest \ TIMESPAN
  130. consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g. 7d or 12m.
  131. .TP
  132. .BI \-\-older \ TIMESPAN
  133. consider archives older than (now \- TIMESPAN), e.g. 7d oder 12m.
  134. .TP
  135. .BI \-\-newer \ TIMESPAN
  136. consider archives newer than (now \- TIMESPAN), e.g. 7d or 12m.
  137. .UNINDENT
  138. .SH EXAMPLES
  139. .INDENT 0.0
  140. .INDENT 3.5
  141. .sp
  142. .nf
  143. .ft C
  144. # 0. Have borg 2.0 installed on client AND server, have a b12 repo copy for testing.
  145. # 1. Create a new \(dqrelated\(dq repository:
  146. # here, the existing borg 1.2 repo used repokey\-blake2 (and aes\-ctr mode),
  147. # thus we use repokey\-blake2\-aes\-ocb for the new borg 2.0 repo.
  148. # staying with the same chunk id algorithm (blake2) and with the same
  149. # key material (via \-\-other\-repo <oldrepo>) will make deduplication work
  150. # between old archives (copied with borg transfer) and future ones.
  151. # the AEAD cipher does not matter (everything must be re\-encrypted and
  152. # re\-authenticated anyway), you could also choose repokey\-blake2\-chacha20\-poly1305.
  153. # in case your old borg repo did not use blake2, just remove the \(dq\-blake2\(dq.
  154. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 rcreate \e
  155. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-e repokey\-blake2\-aes\-ocb
  156. # 2. Check what and how much it would transfer:
  157. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  158. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-\-dry\-run
  159. # 3. Transfer (copy) archives from old repo into new repo (takes time and space!):
  160. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  161. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12
  162. # 4. Check if we have everything (same as 2.):
  163. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  164. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-\-dry\-run
  165. .ft P
  166. .fi
  167. .UNINDENT
  168. .UNINDENT
  169. .SH SEE ALSO
  170. .sp
  171. \fIborg\-common(1)\fP
  172. .SH AUTHOR
  173. The Borg Collective
  174. .\" Generated by docutils manpage writer.
  175. .