borg-transfer.1 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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" "2025-05-22" "" "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. Optionally, it can also re\-chunk the transferred data using different chunker parameters.
  42. .sp
  43. It is easiest (and fastest) to give \fB\-\-compression=COMPRESSION \-\-recompress=never\fP using
  44. the same COMPRESSION mode as in the SRC_REPO \- borg will use that COMPRESSION for metadata (in
  45. any case) and keep data compressed \(dqas is\(dq (saves time as no data compression is needed).
  46. .sp
  47. If you want to globally change compression while transferring archives to the DST_REPO,
  48. give \fB\-\-compress=WANTED_COMPRESSION \-\-recompress=always\fP\&.
  49. .sp
  50. The default is to transfer all archives.
  51. .sp
  52. You could use the misc. archive filter options to limit which archives it will
  53. transfer, e.g. using the \fB\-a\fP option. This is recommended for big
  54. repositories with multiple data sets to keep the runtime per invocation lower.
  55. .SS General purpose archive transfer
  56. .sp
  57. Transfer borg2 archives into a related other borg2 repository:
  58. .INDENT 0.0
  59. .INDENT 3.5
  60. .sp
  61. .EX
  62. # create a related DST_REPO (reusing key material from SRC_REPO), so that
  63. # chunking and chunk id generation will work in the same way as before.
  64. borg \-\-repo=DST_REPO repo\-create \-\-encryption=DST_ENC \-\-other\-repo=SRC_REPO
  65. # transfer archives from SRC_REPO to DST_REPO
  66. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-dry\-run # check what it would do
  67. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO # do it!
  68. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-dry\-run # check! anything left?
  69. .EE
  70. .UNINDENT
  71. .UNINDENT
  72. .SS Data migration / upgrade from borg 1.x
  73. .sp
  74. To migrate your borg 1.x archives into a related, new borg2 repository, usage is quite similar
  75. to the above, but you need the \fB\-\-from\-borg1\fP option:
  76. .INDENT 0.0
  77. .INDENT 3.5
  78. .sp
  79. .EX
  80. borg \-\-repo=DST_REPO repocreate \-\-encryption=DST_ENC \-\-other\-repo=SRC_REPO \-\-from\-borg1
  81. # to continue using lz4 compression as you did in SRC_REPO:
  82. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-from\-borg1 \e
  83. \-\-compress=lz4 \-\-recompress=never
  84. # alternatively, to recompress everything to zstd,3:
  85. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-from\-borg1 \e
  86. \-\-compress=zstd,3 \-\-recompress=always
  87. # to re\-chunk using different chunker parameters:
  88. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \e
  89. \-\-chunker\-params=buzhash,19,23,21,4095
  90. .EE
  91. .UNINDENT
  92. .UNINDENT
  93. .SH OPTIONS
  94. .sp
  95. See \fIborg\-common(1)\fP for common options of Borg commands.
  96. .SS options
  97. .INDENT 0.0
  98. .TP
  99. .B \-n\fP,\fB \-\-dry\-run
  100. do not change repository, just check
  101. .TP
  102. .BI \-\-other\-repo \ SRC_REPOSITORY
  103. transfer archives from the other repository
  104. .TP
  105. .B \-\-from\-borg1
  106. other repository is borg 1.x
  107. .TP
  108. .BI \-\-upgrader \ UPGRADER
  109. use the upgrader to convert transferred data (default: no conversion)
  110. .TP
  111. .BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
  112. select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
  113. .TP
  114. .BI \-\-recompress \ MODE
  115. 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.
  116. .TP
  117. .BI \-\-chunker\-params \ PARAMS
  118. rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or \fIdefault\fP to use the chunker defaults. default: do not rechunk
  119. .UNINDENT
  120. .SS Archive filters
  121. .INDENT 0.0
  122. .TP
  123. .BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
  124. only consider archives matching all patterns. see \(dqborg help match\-archives\(dq.
  125. .TP
  126. .BI \-\-sort\-by \ KEYS
  127. Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
  128. .TP
  129. .BI \-\-first \ N
  130. consider first N archives after other filters were applied
  131. .TP
  132. .BI \-\-last \ N
  133. consider last N archives after other filters were applied
  134. .TP
  135. .BI \-\-oldest \ TIMESPAN
  136. consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
  137. .TP
  138. .BI \-\-newest \ TIMESPAN
  139. consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g. 7d or 12m.
  140. .TP
  141. .BI \-\-older \ TIMESPAN
  142. consider archives older than (now \- TIMESPAN), e.g. 7d or 12m.
  143. .TP
  144. .BI \-\-newer \ TIMESPAN
  145. consider archives newer than (now \- TIMESPAN), e.g. 7d or 12m.
  146. .UNINDENT
  147. .SH EXAMPLES
  148. .INDENT 0.0
  149. .INDENT 3.5
  150. .sp
  151. .EX
  152. # 0. Have borg 2.0 installed on client AND server, have a b12 repo copy for testing.
  153. # 1. Create a new \(dqrelated\(dq repository:
  154. # here, the existing borg 1.2 repo used repokey\-blake2 (and aes\-ctr mode),
  155. # thus we use repokey\-blake2\-aes\-ocb for the new borg 2.0 repo.
  156. # staying with the same chunk id algorithm (blake2) and with the same
  157. # key material (via \-\-other\-repo <oldrepo>) will make deduplication work
  158. # between old archives (copied with borg transfer) and future ones.
  159. # the AEAD cipher does not matter (everything must be re\-encrypted and
  160. # re\-authenticated anyway), you could also choose repokey\-blake2\-chacha20\-poly1305.
  161. # in case your old borg repo did not use blake2, just remove the \(dq\-blake2\(dq.
  162. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 repo\-create \e
  163. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-e repokey\-blake2\-aes\-ocb
  164. # 2. Check what and how much it would transfer:
  165. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  166. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-\-dry\-run
  167. # 3. Transfer (copy) archives from old repo into new repo (takes time and space!):
  168. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  169. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12
  170. # 4. Check if we have everything (same as 2.):
  171. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  172. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-\-dry\-run
  173. .EE
  174. .UNINDENT
  175. .UNINDENT
  176. .SH SEE ALSO
  177. .sp
  178. \fIborg\-common(1)\fP
  179. .SH AUTHOR
  180. The Borg Collective
  181. .\" Generated by docutils manpage writer.
  182. .