transfer.rst.inc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_transfer:
  3. borg transfer
  4. -------------
  5. .. code-block:: none
  6. borg [common options] transfer [options]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  10. | **options** |
  11. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  12. | | ``-n``, ``--dry-run`` | do not change repository, just check |
  13. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | | ``--other-repo SRC_REPOSITORY`` | transfer archives from the other repository |
  15. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | | ``--from-borg1`` | other repository is borg 1.x |
  17. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | | ``--upgrader UPGRADER`` | use the upgrader to convert transferred data (default: no conversion) |
  19. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | | ``-C COMPRESSION``, ``--compression COMPRESSION`` | select compression algorithm, see the output of the "borg help compression" command for details. |
  21. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | | ``--recompress MODE`` | recompress data chunks according to `MODE` and ``--compression``. Possible modes are `always`: recompress unconditionally; and `never`: do not recompress (faster: re-uses compressed data chunks w/o change).If no MODE is given, `always` will be used. Not passing --recompress is equivalent to "--recompress never". |
  23. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | | ``--chunker-params PARAMS`` | rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. default: do not rechunk |
  25. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | .. class:: borg-common-opt-ref |
  27. | |
  28. | :ref:`common_options` |
  29. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | **Archive filters** — Archive filters can be applied to repository targets. |
  31. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | | ``-a PATTERN``, ``--match-archives PATTERN`` | only consider archives matching all patterns. see "borg help match-archives". |
  33. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | | ``--sort-by KEYS`` | Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp |
  35. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | | ``--first N`` | consider first N archives after other filters were applied |
  37. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | | ``--last N`` | consider last N archives after other filters were applied |
  39. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | | ``--oldest TIMESPAN`` | consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g. 7d or 12m. |
  41. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | | ``--newest TIMESPAN`` | consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g. 7d or 12m. |
  43. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | | ``--older TIMESPAN`` | consider archives older than (now - TIMESPAN), e.g. 7d or 12m. |
  45. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | | ``--newer TIMESPAN`` | consider archives newer than (now - TIMESPAN), e.g. 7d or 12m. |
  47. +-----------------------------------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. .. raw:: html
  49. <script type='text/javascript'>
  50. $(document).ready(function () {
  51. $('.borg-options-table colgroup').remove();
  52. })
  53. </script>
  54. .. only:: latex
  55. options
  56. -n, --dry-run do not change repository, just check
  57. --other-repo SRC_REPOSITORY transfer archives from the other repository
  58. --from-borg1 other repository is borg 1.x
  59. --upgrader UPGRADER use the upgrader to convert transferred data (default: no conversion)
  60. -C COMPRESSION, --compression COMPRESSION select compression algorithm, see the output of the "borg help compression" command for details.
  61. --recompress MODE recompress data chunks according to `MODE` and ``--compression``. Possible modes are `always`: recompress unconditionally; and `never`: do not recompress (faster: re-uses compressed data chunks w/o change).If no MODE is given, `always` will be used. Not passing --recompress is equivalent to "--recompress never".
  62. --chunker-params PARAMS rechunk using given chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE) or `default` to use the chunker defaults. default: do not rechunk
  63. :ref:`common_options`
  64. |
  65. Archive filters
  66. -a PATTERN, --match-archives PATTERN only consider archives matching all patterns. see "borg help match-archives".
  67. --sort-by KEYS Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id, tags, host, user; default is: timestamp
  68. --first N consider first N archives after other filters were applied
  69. --last N consider last N archives after other filters were applied
  70. --oldest TIMESPAN consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.
  71. --newest TIMESPAN consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g. 7d or 12m.
  72. --older TIMESPAN consider archives older than (now - TIMESPAN), e.g. 7d or 12m.
  73. --newer TIMESPAN consider archives newer than (now - TIMESPAN), e.g. 7d or 12m.
  74. Description
  75. ~~~~~~~~~~~
  76. This command transfers archives from one repository to another repository.
  77. Optionally, it can also upgrade the transferred data.
  78. Optionally, it can also recompress the transferred data.
  79. Optionally, it can also re-chunk the transferred data using different chunker parameters.
  80. It is easiest (and fastest) to give ``--compression=COMPRESSION --recompress=never`` using
  81. the same COMPRESSION mode as in the SRC_REPO - borg will use that COMPRESSION for metadata (in
  82. any case) and keep data compressed "as is" (saves time as no data compression is needed).
  83. If you want to globally change compression while transferring archives to the DST_REPO,
  84. give ``--compress=WANTED_COMPRESSION --recompress=always``.
  85. The default is to transfer all archives.
  86. You could use the misc. archive filter options to limit which archives it will
  87. transfer, e.g. using the ``-a`` option. This is recommended for big
  88. repositories with multiple data sets to keep the runtime per invocation lower.
  89. General purpose archive transfer
  90. ++++++++++++++++++++++++++++++++
  91. Transfer borg2 archives into a related other borg2 repository::
  92. # create a related DST_REPO (reusing key material from SRC_REPO), so that
  93. # chunking and chunk id generation will work in the same way as before.
  94. borg --repo=DST_REPO repo-create --encryption=DST_ENC --other-repo=SRC_REPO
  95. # transfer archives from SRC_REPO to DST_REPO
  96. borg --repo=DST_REPO transfer --other-repo=SRC_REPO --dry-run # check what it would do
  97. borg --repo=DST_REPO transfer --other-repo=SRC_REPO # do it!
  98. borg --repo=DST_REPO transfer --other-repo=SRC_REPO --dry-run # check! anything left?
  99. Data migration / upgrade from borg 1.x
  100. ++++++++++++++++++++++++++++++++++++++
  101. To migrate your borg 1.x archives into a related, new borg2 repository, usage is quite similar
  102. to the above, but you need the ``--from-borg1`` option::
  103. borg --repo=DST_REPO repocreate --encryption=DST_ENC --other-repo=SRC_REPO --from-borg1
  104. # to continue using lz4 compression as you did in SRC_REPO:
  105. borg --repo=DST_REPO transfer --other-repo=SRC_REPO --from-borg1 \
  106. --compress=lz4 --recompress=never
  107. # alternatively, to recompress everything to zstd,3:
  108. borg --repo=DST_REPO transfer --other-repo=SRC_REPO --from-borg1 \
  109. --compress=zstd,3 --recompress=always
  110. # to re-chunk using different chunker parameters:
  111. borg --repo=DST_REPO transfer --other-repo=SRC_REPO \
  112. --chunker-params=buzhash,19,23,21,4095