borg-transfer.1 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 "2024-09-09" "" "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. .nf
  61. .ft C
  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. .ft P
  70. .fi
  71. .UNINDENT
  72. .UNINDENT
  73. .SS Data migration / upgrade from borg 1.x
  74. .sp
  75. To migrate your borg 1.x archives into a related, new borg2 repository, usage is quite similar
  76. to the above, but you need the \fB\-\-from\-borg1\fP option:
  77. .INDENT 0.0
  78. .INDENT 3.5
  79. .sp
  80. .nf
  81. .ft C
  82. borg \-\-repo=DST_REPO repocreate \-\-encryption=DST_ENC \-\-other\-repo=SRC_REPO \-\-from\-borg1
  83. # to continue using lz4 compression as you did in SRC_REPO:
  84. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-from\-borg1 \e
  85. \-\-compress=lz4 \-\-recompress=never
  86. # alternatively, to recompress everything to zstd,3:
  87. borg \-\-repo=DST_REPO transfer \-\-other\-repo=SRC_REPO \-\-from\-borg1 \e
  88. \-\-compress=zstd,3 \-\-recompress=always
  89. .ft P
  90. .fi
  91. .UNINDENT
  92. .UNINDENT
  93. .SH OPTIONS
  94. .sp
  95. See \fIborg\-common(1)\fP for common options of Borg commands.
  96. .SS optional arguments
  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. .UNINDENT
  117. .SS Archive filters
  118. .INDENT 0.0
  119. .TP
  120. .BI \-a \ PATTERN\fR,\fB \ \-\-match\-archives \ PATTERN
  121. only consider archive names matching the pattern. see \(dqborg help match\-archives\(dq.
  122. .TP
  123. .BI \-\-sort\-by \ KEYS
  124. Comma\-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
  125. .TP
  126. .BI \-\-first \ N
  127. consider first N archives after other filters were applied
  128. .TP
  129. .BI \-\-last \ N
  130. consider last N archives after other filters were applied
  131. .TP
  132. .BI \-\-oldest \ TIMESPAN
  133. consider archives between the oldest archive\(aqs timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
  134. .TP
  135. .BI \-\-newest \ TIMESPAN
  136. consider archives between the newest archive\(aqs timestamp and (newest \- TIMESPAN), e.g. 7d or 12m.
  137. .TP
  138. .BI \-\-older \ TIMESPAN
  139. consider archives older than (now \- TIMESPAN), e.g. 7d or 12m.
  140. .TP
  141. .BI \-\-newer \ TIMESPAN
  142. consider archives newer than (now \- TIMESPAN), e.g. 7d or 12m.
  143. .UNINDENT
  144. .SH EXAMPLES
  145. .INDENT 0.0
  146. .INDENT 3.5
  147. .sp
  148. .nf
  149. .ft C
  150. # 0. Have borg 2.0 installed on client AND server, have a b12 repo copy for testing.
  151. # 1. Create a new \(dqrelated\(dq repository:
  152. # here, the existing borg 1.2 repo used repokey\-blake2 (and aes\-ctr mode),
  153. # thus we use repokey\-blake2\-aes\-ocb for the new borg 2.0 repo.
  154. # staying with the same chunk id algorithm (blake2) and with the same
  155. # key material (via \-\-other\-repo <oldrepo>) will make deduplication work
  156. # between old archives (copied with borg transfer) and future ones.
  157. # the AEAD cipher does not matter (everything must be re\-encrypted and
  158. # re\-authenticated anyway), you could also choose repokey\-blake2\-chacha20\-poly1305.
  159. # in case your old borg repo did not use blake2, just remove the \(dq\-blake2\(dq.
  160. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 repo\-create \e
  161. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-e repokey\-blake2\-aes\-ocb
  162. # 2. Check what and how much it would transfer:
  163. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  164. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-\-dry\-run
  165. # 3. Transfer (copy) archives from old repo into new repo (takes time and space!):
  166. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  167. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12
  168. # 4. Check if we have everything (same as 2.):
  169. $ borg \-\-repo ssh://borg2@borgbackup/./tests/b20 transfer \-\-upgrader=From12To20 \e
  170. \-\-other\-repo ssh://borg2@borgbackup/./tests/b12 \-\-dry\-run
  171. .ft P
  172. .fi
  173. .UNINDENT
  174. .UNINDENT
  175. .SH SEE ALSO
  176. .sp
  177. \fIborg\-common(1)\fP
  178. .SH AUTHOR
  179. The Borg Collective
  180. .\" Generated by docutils manpage writer.
  181. .