2
0

borg-upgrade.1 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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-UPGRADE" "1" "2025-04-18" "" "borg backup tool"
  31. .SH NAME
  32. borg-upgrade \- upgrade a repository from a previous version
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] upgrade [options] [REPOSITORY]
  36. .SH DESCRIPTION
  37. .sp
  38. Upgrade an existing, local Borg repository.
  39. .SS When you do not need borg upgrade
  40. .sp
  41. Not every change requires that you run \fBborg upgrade\fP\&.
  42. .sp
  43. You do \fBnot\fP need to run it when:
  44. .INDENT 0.0
  45. .IP \(bu 2
  46. moving your repository to a different place
  47. .IP \(bu 2
  48. upgrading to another point release (like 1.0.x to 1.0.y),
  49. except when noted otherwise in the changelog
  50. .IP \(bu 2
  51. upgrading from 1.0.x to 1.1.x,
  52. except when noted otherwise in the changelog
  53. .UNINDENT
  54. .SS Borg 1.x.y upgrades
  55. .sp
  56. Archive TAM authentication:
  57. .sp
  58. Use \fBborg upgrade \-\-archives\-tam REPO\fP to add archive TAMs to all
  59. archives that are not TAM authenticated yet.
  60. This is a convenient method to just trust all archives present \- if
  61. an archive does not have TAM authentication yet, a TAM will be added.
  62. Archives created by old borg versions < 1.0.9 do not have TAMs.
  63. Archives created by newer borg version should have TAMs already.
  64. If you have a high risk environment, you should not just run this,
  65. but first verify that the archives are authentic and not malicious
  66. (== have good content, have a good timestamp).
  67. Borg 1.2.5+ needs all archives to be TAM authenticated for safety reasons.
  68. .sp
  69. This upgrade needs to be done once per repository.
  70. .sp
  71. Manifest TAM authentication:
  72. .sp
  73. Use \fBborg upgrade \-\-tam REPO\fP to require manifest authentication
  74. introduced with Borg 1.0.9 to address security issues. This means
  75. that modifying the repository after doing this with a version prior
  76. to 1.0.9 will raise a validation error, so only perform this upgrade
  77. after updating all clients using the repository to 1.0.9 or newer.
  78. .sp
  79. This upgrade should be done on each client for safety reasons.
  80. .sp
  81. If a repository is accidentally modified with a pre\-1.0.9 client after
  82. this upgrade, use \fBborg upgrade \-\-tam \-\-force REPO\fP to remedy it.
  83. .sp
  84. If you routinely do this you might not want to enable this upgrade
  85. (which will leave you exposed to the security issue). You can
  86. reverse the upgrade by issuing \fBborg upgrade \-\-disable\-tam REPO\fP\&.
  87. .sp
  88. See
  89. <https://borgbackup.readthedocs.io/en/stable/changes.html#pre\-1\-0\-9\-manifest\-spoofing\-vulnerability>
  90. for details.
  91. .SS Attic and Borg 0.xx to Borg 1.x
  92. .sp
  93. This currently supports converting an Attic repository to Borg and also
  94. helps with converting Borg 0.xx to 1.0.
  95. .sp
  96. Currently, only LOCAL repositories can be upgraded (issue #465).
  97. .sp
  98. Please note that \fBborg create\fP (since 1.0.0) uses bigger chunks by
  99. default than old borg or attic did, so the new chunks won\(aqt deduplicate
  100. with the old chunks in the upgraded repository.
  101. See \fB\-\-chunker\-params\fP option of \fBborg create\fP and \fBborg recreate\fP\&.
  102. .sp
  103. \fBborg upgrade\fP will change the magic strings in the repository\(aqs
  104. segments to match the new Borg magic strings. The keyfiles found in
  105. $ATTIC_KEYS_DIR or ~/.attic/keys/ will also be converted and
  106. copied to $BORG_KEYS_DIR or ~/.config/borg/keys.
  107. .sp
  108. The cache files are converted, from $ATTIC_CACHE_DIR or
  109. ~/.cache/attic to $BORG_CACHE_DIR or ~/.cache/borg, but the
  110. cache layout between Borg and Attic changed, so it is possible
  111. the first backup after the conversion takes longer than expected
  112. due to the cache resync.
  113. .sp
  114. Upgrade should be able to resume if interrupted, although it
  115. will still iterate over all segments. If you want to start
  116. from scratch, use \fIborg delete\fP over the copied repository to
  117. make sure the cache files are also removed:
  118. .INDENT 0.0
  119. .INDENT 3.5
  120. .sp
  121. .EX
  122. borg delete borg
  123. .EE
  124. .UNINDENT
  125. .UNINDENT
  126. .sp
  127. Unless \fB\-\-inplace\fP is specified, the upgrade process first creates a backup
  128. copy of the repository, in REPOSITORY.before\-upgrade\-DATETIME, using hardlinks.
  129. This requires that the repository and its parent directory reside on same
  130. filesystem so the hardlink copy can work.
  131. This takes longer than in place upgrades, but is much safer and gives
  132. progress information (as opposed to \fBcp \-al\fP). Once you are satisfied
  133. with the conversion, you can safely destroy the backup copy.
  134. .sp
  135. WARNING: Running the upgrade in place will make the current
  136. copy unusable with older version, with no way of going back
  137. to previous versions. This can PERMANENTLY DAMAGE YOUR
  138. REPOSITORY! Attic CAN NOT READ BORG REPOSITORIES, as the
  139. magic strings have changed. You have been warned.
  140. .SH OPTIONS
  141. .sp
  142. See \fIborg\-common(1)\fP for common options of Borg commands.
  143. .SS arguments
  144. .INDENT 0.0
  145. .TP
  146. .B REPOSITORY
  147. path to the repository to be upgraded
  148. .UNINDENT
  149. .SS options
  150. .INDENT 0.0
  151. .TP
  152. .B \-n\fP,\fB \-\-dry\-run
  153. do not change repository
  154. .TP
  155. .B \-\-inplace
  156. rewrite repository in place, with no chance of going back to older versions of the repository.
  157. .TP
  158. .B \-\-force
  159. Force upgrade
  160. .TP
  161. .B \-\-tam
  162. Enable manifest authentication (in key and cache) (Borg 1.0.9 and later).
  163. .TP
  164. .B \-\-check\-tam
  165. check manifest authentication (in key and cache).
  166. .TP
  167. .B \-\-disable\-tam
  168. Disable manifest authentication (in key and cache).
  169. .TP
  170. .B \-\-check\-archives\-tam
  171. check TAM authentication for all archives.
  172. .TP
  173. .B \-\-archives\-tam
  174. add TAM authentication for all archives.
  175. .UNINDENT
  176. .SH EXAMPLES
  177. .INDENT 0.0
  178. .INDENT 3.5
  179. .sp
  180. .EX
  181. # Upgrade the borg repository to the most recent version.
  182. $ borg upgrade \-v /path/to/repo
  183. making a hardlink copy in /path/to/repo.before\-upgrade\-2016\-02\-15\-20:51:55
  184. opening attic repository with borg and converting
  185. no key file found for repository
  186. converting repo index /path/to/repo/index.0
  187. converting 1 segments...
  188. converting borg 0.xx to borg current
  189. no key file found for repository
  190. .EE
  191. .UNINDENT
  192. .UNINDENT
  193. .SS Upgrading a passphrase encrypted attic repo
  194. .sp
  195. attic offered a \(dqpassphrase\(dq encryption mode, but this was removed in borg 1.0
  196. and replaced by the \(dqrepokey\(dq mode (which stores the passphrase\-protected
  197. encryption key into the repository config).
  198. .sp
  199. Thus, to upgrade a \(dqpassphrase\(dq attic repo to a \(dqrepokey\(dq borg repo, 2 steps
  200. are needed, in this order:
  201. .INDENT 0.0
  202. .IP \(bu 2
  203. borg upgrade repo
  204. .IP \(bu 2
  205. borg key migrate\-to\-repokey repo
  206. .UNINDENT
  207. .SH SEE ALSO
  208. .sp
  209. \fIborg\-common(1)\fP
  210. .SH AUTHOR
  211. The Borg Collective
  212. .\" Generated by docutils manpage writer.
  213. .