upgrade.rst.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_upgrade:
  3. borg upgrade
  4. ------------
  5. .. code-block:: none
  6. borg [common options] upgrade [options] [REPOSITORY]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  12. | | ``REPOSITORY`` | path to the repository to be upgraded |
  13. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  14. | **options** |
  15. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  16. | | ``-n``, ``--dry-run`` | do not change repository |
  17. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  18. | | ``--inplace`` | rewrite repository in place, with no chance of going back to older versions of the repository. |
  19. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  20. | | ``--force`` | Force upgrade |
  21. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  22. | | ``--tam`` | Enable manifest authentication (in key and cache) (Borg 1.0.9 and later). |
  23. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  24. | | ``--check-tam`` | check manifest authentication (in key and cache). |
  25. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  26. | | ``--disable-tam`` | Disable manifest authentication (in key and cache). |
  27. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  28. | | ``--check-archives-tam`` | check TAM authentication for all archives. |
  29. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  30. | | ``--archives-tam`` | add TAM authentication for all archives. |
  31. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  32. | .. class:: borg-common-opt-ref |
  33. | |
  34. | :ref:`common_options` |
  35. +-------------------------------------------------------+--------------------------+------------------------------------------------------------------------------------------------+
  36. .. raw:: html
  37. <script type='text/javascript'>
  38. $(document).ready(function () {
  39. $('.borg-options-table colgroup').remove();
  40. })
  41. </script>
  42. .. only:: latex
  43. REPOSITORY
  44. path to the repository to be upgraded
  45. options
  46. -n, --dry-run do not change repository
  47. --inplace rewrite repository in place, with no chance of going back to older versions of the repository.
  48. --force Force upgrade
  49. --tam Enable manifest authentication (in key and cache) (Borg 1.0.9 and later).
  50. --check-tam check manifest authentication (in key and cache).
  51. --disable-tam Disable manifest authentication (in key and cache).
  52. --check-archives-tam check TAM authentication for all archives.
  53. --archives-tam add TAM authentication for all archives.
  54. :ref:`common_options`
  55. |
  56. Description
  57. ~~~~~~~~~~~
  58. Upgrade an existing, local Borg repository.
  59. When you do not need borg upgrade
  60. +++++++++++++++++++++++++++++++++
  61. Not every change requires that you run ``borg upgrade``.
  62. You do **not** need to run it when:
  63. - moving your repository to a different place
  64. - upgrading to another point release (like 1.0.x to 1.0.y),
  65. except when noted otherwise in the changelog
  66. - upgrading from 1.0.x to 1.1.x,
  67. except when noted otherwise in the changelog
  68. Borg 1.x.y upgrades
  69. +++++++++++++++++++
  70. Archive TAM authentication:
  71. Use ``borg upgrade --archives-tam REPO`` to add archive TAMs to all
  72. archives that are not TAM authenticated yet.
  73. This is a convenient method to just trust all archives present - if
  74. an archive does not have TAM authentication yet, a TAM will be added.
  75. Archives created by old borg versions < 1.0.9 do not have TAMs.
  76. Archives created by newer borg version should have TAMs already.
  77. If you have a high risk environment, you should not just run this,
  78. but first verify that the archives are authentic and not malicious
  79. (== have good content, have a good timestamp).
  80. Borg 1.2.5+ needs all archives to be TAM authenticated for safety reasons.
  81. This upgrade needs to be done once per repository.
  82. Manifest TAM authentication:
  83. Use ``borg upgrade --tam REPO`` to require manifest authentication
  84. introduced with Borg 1.0.9 to address security issues. This means
  85. that modifying the repository after doing this with a version prior
  86. to 1.0.9 will raise a validation error, so only perform this upgrade
  87. after updating all clients using the repository to 1.0.9 or newer.
  88. This upgrade should be done on each client for safety reasons.
  89. If a repository is accidentally modified with a pre-1.0.9 client after
  90. this upgrade, use ``borg upgrade --tam --force REPO`` to remedy it.
  91. If you routinely do this you might not want to enable this upgrade
  92. (which will leave you exposed to the security issue). You can
  93. reverse the upgrade by issuing ``borg upgrade --disable-tam REPO``.
  94. See
  95. https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability
  96. for details.
  97. Attic and Borg 0.xx to Borg 1.x
  98. +++++++++++++++++++++++++++++++
  99. This currently supports converting an Attic repository to Borg and also
  100. helps with converting Borg 0.xx to 1.0.
  101. Currently, only LOCAL repositories can be upgraded (issue #465).
  102. Please note that ``borg create`` (since 1.0.0) uses bigger chunks by
  103. default than old borg or attic did, so the new chunks won't deduplicate
  104. with the old chunks in the upgraded repository.
  105. See ``--chunker-params`` option of ``borg create`` and ``borg recreate``.
  106. ``borg upgrade`` will change the magic strings in the repository's
  107. segments to match the new Borg magic strings. The keyfiles found in
  108. $ATTIC_KEYS_DIR or ~/.attic/keys/ will also be converted and
  109. copied to $BORG_KEYS_DIR or ~/.config/borg/keys.
  110. The cache files are converted, from $ATTIC_CACHE_DIR or
  111. ~/.cache/attic to $BORG_CACHE_DIR or ~/.cache/borg, but the
  112. cache layout between Borg and Attic changed, so it is possible
  113. the first backup after the conversion takes longer than expected
  114. due to the cache resync.
  115. Upgrade should be able to resume if interrupted, although it
  116. will still iterate over all segments. If you want to start
  117. from scratch, use `borg delete` over the copied repository to
  118. make sure the cache files are also removed::
  119. borg delete borg
  120. Unless ``--inplace`` is specified, the upgrade process first creates a backup
  121. copy of the repository, in REPOSITORY.before-upgrade-DATETIME, using hardlinks.
  122. This requires that the repository and its parent directory reside on same
  123. filesystem so the hardlink copy can work.
  124. This takes longer than in place upgrades, but is much safer and gives
  125. progress information (as opposed to ``cp -al``). Once you are satisfied
  126. with the conversion, you can safely destroy the backup copy.
  127. WARNING: Running the upgrade in place will make the current
  128. copy unusable with older version, with no way of going back
  129. to previous versions. This can PERMANENTLY DAMAGE YOUR
  130. REPOSITORY! Attic CAN NOT READ BORG REPOSITORIES, as the
  131. magic strings have changed. You have been warned.