22
33Examples
44~~~~~~~~
5+
6+ To keep the following examples short and readable, we export the repository
7+ locations and passphrases first:
8+
9+ ::
10+
11+ export BORG_REPO=ssh://borg2@borgbackup/./tests/b20
12+ export BORG_PASSPHRASE='your-borg2-repo-passphrase'
13+ export BORG_OTHER_REPO=ssh://borg2@borgbackup/./tests/b1x
14+ export BORG_OTHER_PASSPHRASE='your-borg1-repo-passphrase'
15+
516::
617
7- # 0. Have Borg 2.0 installed on the client AND server; have a b12 repository copy for testing.
18+ # Borg 1.x repository -> Borg 2.0 repository (hmac-sha256 -> hmac-sha256, keeping the same chunk ID algorithm)
19+
20+ # 0. Have Borg 2.0 installed on the client AND server; have a Borg 1.x repository copy for testing.
821
922 # 1. Create a new "related" repository:
10- # Here, the existing Borg 1.2 repository used repokey-blake2 (and AES-CTR mode),
11- # thus we use repokey-blake2- aes-ocb for the new Borg 2.0 repository.
12- # Staying with the same chunk ID algorithm (BLAKE2 ) and with the same
13- # key material (via --other-repo <oldrepo> ) will make deduplication work
23+ # Here, the existing Borg 1.x repository used repokey (and AES-CTR mode),
24+ # thus we use repokey-aes-ocb for the new Borg 2.0 repository.
25+ # Staying with the same chunk ID algorithm (hmac-sha256 ) and with the same
26+ # key material (via BORG_OTHER_REPO ) will make deduplication work
1427 # between old archives (copied with borg transfer) and future ones.
1528 # The AEAD cipher does not matter (everything must be re-encrypted and
16- # re-authenticated anyway); you could also choose repokey-blake2-chacha20-poly1305.
17- # In case your old Borg repository did not use BLAKE2, just remove the "-blake2".
18- $ borg --repo ssh://borg2@borgbackup/./tests/b20 repo-create \
19- --other-repo ssh://borg2@borgbackup/./tests/b12 -e repokey-blake2-aes-ocb
29+ # re-authenticated anyway); you could also choose repokey-chacha20-poly1305.
30+ $ borg repo-create -e repokey-aes-ocb
31+
32+ # 2. Check what and how much it would transfer:
33+ $ borg transfer --from-borg1 --dry-run
34+
35+ # 3. Transfer (copy) archives from the old repository into the new repository (takes time and space!):
36+ $ borg transfer --from-borg1
37+
38+ # 4. Check whether we have everything (same as step 2):
39+ $ borg transfer --from-borg1 --dry-run
40+
41+ ::
42+
43+ # Borg 1.x repository -> Borg 2.0 repository (blake2 -> blake3, changing the chunk ID algorithm)
44+
45+ # 0. Have Borg 2.0 installed on the client AND server; have a Borg 1.x repository copy for testing.
46+
47+ # 1. Create a new "related" repository:
48+ # Here, the existing Borg 1.x repository used repokey-blake2 (and AES-CTR mode),
49+ # thus we use repokey-blake3-aes-ocb for the new Borg 2.0 repository.
50+ # We need to change from blake2 to blake3, because blake2 is not supported
51+ # for borg2 repos (blake3 is much faster). Because we change how chunk IDs are
52+ # computed, we need to re-chunk everything while doing the transfer.
53+ # The chunker parameters you provide here should be the same as you will
54+ # use for all future Borg 2.0 archives.
55+ # The AEAD cipher does not matter (everything must be re-encrypted and
56+ # re-authenticated anyway); you could also choose repokey-blake3-chacha20-poly1305.
57+ $ borg repo-create -e repokey-blake3-aes-ocb
58+ $ export CHUNKER_PARAMS="buzhash64,19,23,21,4095"
2059
2160 # 2. Check what and how much it would transfer:
22- $ borg --repo ssh://borg2@borgbackup/./tests/b20 transfer --upgrader=From12To20 \
23- --other-repo ssh://borg2@borgbackup/./tests/b12 --dry-run
61+ $ borg transfer --from-borg1 --chunker-params=$CHUNKER_PARAMS --dry-run
2462
2563 # 3. Transfer (copy) archives from the old repository into the new repository (takes time and space!):
26- $ borg --repo ssh://borg2@borgbackup/./tests/b20 transfer --upgrader=From12To20 \
27- --other-repo ssh://borg2@borgbackup/./tests/b12
64+ $ borg transfer --from-borg1 --chunker-params=$CHUNKER_PARAMS
2865
2966 # 4. Check whether we have everything (same as step 2):
30- $ borg --repo ssh://borg2@borgbackup/./tests/b20 transfer --upgrader=From12To20 \
31- --other-repo ssh://borg2@borgbackup/./tests/b12 --dry-run
67+ $ borg transfer --from-borg1 --chunker-params=$CHUNKER_PARAMS --dry-run
3268
33- Keyfile considerations when upgrading from borg 1.x
69+ Keyfile considerations when upgrading from Borg 1.x
3470++++++++++++++++++++++++++++++++++++++++++++++++++++
3571
36- If you are using a ``keyfile `` encryption mode (not ``repokey ``), borg 2
37- may not automatically find your borg 1.x key file, because the default
72+ If you are using a ``keyfile `` encryption mode (not ``repokey ``), Borg 2
73+ may not automatically find your Borg 1.x key file, because the default
3874key file directory has changed on some platforms due to the switch to
3975the `platformdirs <https://pypi.org/project/platformdirs/ >`_ library.
4076
41- On **Linux **, there is typically no change -- both borg 1.x and borg 2
77+ On **Linux **, there is typically no change -- both Borg 1.x and Borg 2
4278use ``~/.config/borg/keys/ ``.
4379
44- On **macOS **, borg 1.x stored key files in ``~/.config/borg/keys/ ``,
45- but borg 2 defaults to ``~/Library/Application Support/borg/keys/ ``.
80+ On **macOS **, Borg 1.x stored key files in ``~/.config/borg/keys/ ``,
81+ but Borg 2 defaults to ``~/Library/Application Support/borg/keys/ ``.
4682
47- On **Windows **, borg 1.x used XDG-style paths (e.g. ``~/.config/borg/keys/ ``),
48- while borg 2 defaults to ``C:\Users\<user>\AppData\Roaming\borg\keys\ ``.
83+ On **Windows **, Borg 1.x used XDG-style paths (e.g. ``~/.config/borg/keys/ ``),
84+ while Borg 2 defaults to ``C:\Users\<user>\AppData\Roaming\borg\keys\ ``.
4985
50- If borg 2 cannot find your key file, you have several options:
86+ If Borg 2 cannot find your key file, you have several options:
5187
52881. **Copy the key file ** from the old location to the new one.
53892. **Set BORG_KEYS_DIR ** to point to the old key file directory::
@@ -58,13 +94,13 @@ If borg 2 cannot find your key file, you have several options:
5894
5995 export BORG_KEY_FILE=~/.config/borg/keys/your_key_file
6096
61- 4. **Set BORG_BASE_DIR ** to force borg 2 to use the same base directory
62- as borg 1.x::
97+ 4. **Set BORG_BASE_DIR ** to force Borg 2 to use the same base directory
98+ as Borg 1.x::
6399
64100 export BORG_BASE_DIR=$HOME
65101
66- This makes borg 2 use ``$HOME/.config/borg ``, ``$HOME/.cache/borg ``,
67- etc., matching borg 1.x behaviour on all platforms.
102+ This makes Borg 2 use ``$HOME/.config/borg ``, ``$HOME/.cache/borg ``,
103+ etc., matching Borg 1.x behavior on all platforms.
68104
69105See :ref: `env_vars ` for more details on directory environment variables.
70106
0 commit comments