upgrade.rst.inc 9.2 KB

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