(self, subparsers, common_parser, mid_common_parser)
| 270 | ) |
| 271 | |
| 272 | def build_parser_transfer(self, subparsers, common_parser, mid_common_parser): |
| 273 | from ._common import process_epilog |
| 274 | from ._common import define_archive_filters_group |
| 275 | |
| 276 | transfer_epilog = process_epilog( |
| 277 | """ |
| 278 | This command transfers archives from one repository to another repository. |
| 279 | Optionally, it can also upgrade the transferred data. |
| 280 | Optionally, it can also recompress the transferred data. |
| 281 | Optionally, it can also re-chunk the transferred data using different chunker parameters. |
| 282 | |
| 283 | It is easiest (and fastest) to give ``--compression=COMPRESSION --recompress=never`` using |
| 284 | the same COMPRESSION mode as in the SRC_REPO - borg will use that COMPRESSION for metadata (in |
| 285 | any case) and keep data compressed "as is" (saves time as no data compression is needed). |
| 286 | |
| 287 | If you want to globally change compression while transferring archives to the DST_REPO, |
| 288 | give ``--compress=WANTED_COMPRESSION --recompress=always``. |
| 289 | |
| 290 | The default is to transfer all archives. |
| 291 | |
| 292 | You could use the misc. archive filter options to limit which archives it will |
| 293 | transfer, e.g. using the ``-a`` option. This is recommended for big |
| 294 | repositories with multiple data sets to keep the runtime per invocation lower. |
| 295 | |
| 296 | General purpose archive transfer |
| 297 | ++++++++++++++++++++++++++++++++ |
| 298 | |
| 299 | Transfer borg2 archives into a related other borg2 repository:: |
| 300 | |
| 301 | # create a related DST_REPO (reusing key material from SRC_REPO), so that |
| 302 | # chunking and chunk id generation will work in the same way as before. |
| 303 | borg --repo=DST_REPO repo-create --encryption=DST_ENC --other-repo=SRC_REPO |
| 304 | |
| 305 | # transfer archives from SRC_REPO to DST_REPO |
| 306 | borg --repo=DST_REPO transfer --other-repo=SRC_REPO --dry-run # check what it would do |
| 307 | borg --repo=DST_REPO transfer --other-repo=SRC_REPO # do it! |
| 308 | borg --repo=DST_REPO transfer --other-repo=SRC_REPO --dry-run # check! anything left? |
| 309 | |
| 310 | Data migration / upgrade from borg 1.x |
| 311 | ++++++++++++++++++++++++++++++++++++++ |
| 312 | |
| 313 | To migrate your borg 1.x archives into a related, new borg2 repository, usage is quite similar |
| 314 | to the above, but you need the ``--from-borg1`` option:: |
| 315 | |
| 316 | borg --repo=DST_REPO repocreate --encryption=DST_ENC --other-repo=SRC_REPO --from-borg1 |
| 317 | |
| 318 | # to continue using lz4 compression as you did in SRC_REPO: |
| 319 | borg --repo=DST_REPO transfer --other-repo=SRC_REPO --from-borg1 \\ |
| 320 | --compress=lz4 --recompress=never |
| 321 | |
| 322 | # alternatively, to recompress everything to zstd,3: |
| 323 | borg --repo=DST_REPO transfer --other-repo=SRC_REPO --from-borg1 \\ |
| 324 | --compress=zstd,3 --recompress=always |
| 325 | |
| 326 | # to re-chunk using different chunker parameters: |
| 327 | borg --repo=DST_REPO transfer --other-repo=SRC_REPO \\ |
| 328 | --chunker-params=buzhash,19,23,21,4095 |
| 329 |
no test coverage detected