upgrade.rst.inc 8.0 KB

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