borg-upgrade.1 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH BORG-UPGRADE 1 "2019-03-21" "" "borg backup tool"
  4. .SH NAME
  5. borg-upgrade \- upgrade a repository from a previous version
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  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. Use \fBborg upgrade \-\-tam REPO\fP to require manifest authentication
  57. introduced with Borg 1.0.9 to address security issues. This means
  58. that modifying the repository after doing this with a version prior
  59. to 1.0.9 will raise a validation error, so only perform this upgrade
  60. after updating all clients using the repository to 1.0.9 or newer.
  61. .sp
  62. This upgrade should be done on each client for safety reasons.
  63. .sp
  64. If a repository is accidentally modified with a pre\-1.0.9 client after
  65. this upgrade, use \fBborg upgrade \-\-tam \-\-force REPO\fP to remedy it.
  66. .sp
  67. If you routinely do this you might not want to enable this upgrade
  68. (which will leave you exposed to the security issue). You can
  69. reverse the upgrade by issuing \fBborg upgrade \-\-disable\-tam REPO\fP\&.
  70. .sp
  71. See
  72. \fI\%https://borgbackup.readthedocs.io/en/stable/changes.html#pre\-1\-0\-9\-manifest\-spoofing\-vulnerability\fP
  73. for details.
  74. .SS Attic and Borg 0.xx to Borg 1.x
  75. .sp
  76. This currently supports converting an Attic repository to Borg and also
  77. helps with converting Borg 0.xx to 1.0.
  78. .sp
  79. Currently, only LOCAL repositories can be upgraded (issue #465).
  80. .sp
  81. Please note that \fBborg create\fP (since 1.0.0) uses bigger chunks by
  82. default than old borg or attic did, so the new chunks won\(aqt deduplicate
  83. with the old chunks in the upgraded repository.
  84. See \fB\-\-chunker\-params\fP option of \fBborg create\fP and \fBborg recreate\fP\&.
  85. .sp
  86. \fBborg upgrade\fP will change the magic strings in the repository\(aqs
  87. segments to match the new Borg magic strings. The keyfiles found in
  88. $ATTIC_KEYS_DIR or ~/.attic/keys/ will also be converted and
  89. copied to $BORG_KEYS_DIR or ~/.config/borg/keys.
  90. .sp
  91. The cache files are converted, from $ATTIC_CACHE_DIR or
  92. ~/.cache/attic to $BORG_CACHE_DIR or ~/.cache/borg, but the
  93. cache layout between Borg and Attic changed, so it is possible
  94. the first backup after the conversion takes longer than expected
  95. due to the cache resync.
  96. .sp
  97. Upgrade should be able to resume if interrupted, although it
  98. will still iterate over all segments. If you want to start
  99. from scratch, use \fIborg delete\fP over the copied repository to
  100. make sure the cache files are also removed:
  101. .INDENT 0.0
  102. .INDENT 3.5
  103. borg delete borg
  104. .UNINDENT
  105. .UNINDENT
  106. .sp
  107. Unless \fB\-\-inplace\fP is specified, the upgrade process first creates a backup
  108. copy of the repository, in REPOSITORY.before\-upgrade\-DATETIME, using hardlinks.
  109. This requires that the repository and its parent directory reside on same
  110. filesystem so the hardlink copy can work.
  111. This takes longer than in place upgrades, but is much safer and gives
  112. progress information (as opposed to \fBcp \-al\fP). Once you are satisfied
  113. with the conversion, you can safely destroy the backup copy.
  114. .sp
  115. WARNING: Running the upgrade in place will make the current
  116. copy unusable with older version, with no way of going back
  117. to previous versions. This can PERMANENTLY DAMAGE YOUR
  118. REPOSITORY! Attic CAN NOT READ BORG REPOSITORIES, as the
  119. magic strings have changed. You have been warned.
  120. .SH OPTIONS
  121. .sp
  122. See \fIborg\-common(1)\fP for common options of Borg commands.
  123. .SS arguments
  124. .INDENT 0.0
  125. .TP
  126. .B REPOSITORY
  127. path to the repository to be upgraded
  128. .UNINDENT
  129. .SS optional arguments
  130. .INDENT 0.0
  131. .TP
  132. .B \-n\fP,\fB \-\-dry\-run
  133. do not change repository
  134. .TP
  135. .B \-\-inplace
  136. rewrite repository in place, with no chance of going back to older versions of the repository.
  137. .TP
  138. .B \-\-force
  139. Force upgrade
  140. .TP
  141. .B \-\-tam
  142. Enable manifest authentication (in key and cache) (Borg 1.0.9 and later).
  143. .TP
  144. .B \-\-disable\-tam
  145. Disable manifest authentication (in key and cache).
  146. .UNINDENT
  147. .SH EXAMPLES
  148. .INDENT 0.0
  149. .INDENT 3.5
  150. .sp
  151. .nf
  152. .ft C
  153. # Upgrade the borg repository to the most recent version.
  154. $ borg upgrade \-v /path/to/repo
  155. making a hardlink copy in /path/to/repo.before\-upgrade\-2016\-02\-15\-20:51:55
  156. opening attic repository with borg and converting
  157. no key file found for repository
  158. converting repo index /path/to/repo/index.0
  159. converting 1 segments...
  160. converting borg 0.xx to borg current
  161. no key file found for repository
  162. .ft P
  163. .fi
  164. .UNINDENT
  165. .UNINDENT
  166. .SS Upgrading a passphrase encrypted attic repo
  167. .sp
  168. attic offered a "passphrase" encryption mode, but this was removed in borg 1.0
  169. and replaced by the "repokey" mode (which stores the passphrase\-protected
  170. encryption key into the repository config).
  171. .sp
  172. Thus, to upgrade a "passphrase" attic repo to a "repokey" borg repo, 2 steps
  173. are needed, in this order:
  174. .INDENT 0.0
  175. .IP \(bu 2
  176. borg upgrade repo
  177. .IP \(bu 2
  178. borg key migrate\-to\-repokey repo
  179. .UNINDENT
  180. .SH SEE ALSO
  181. .sp
  182. \fIborg\-common(1)\fP
  183. .SH AUTHOR
  184. The Borg Collective
  185. .\" Generated by docutils manpage writer.
  186. .