borg-transfer.1 6.7 KB

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