Help with pool recovery

How can I import a pool from a prior IncusOS installation? I have a ZFS RAID10 pool that was on the old incus and I’d like to import it on the new incus host. I have the recovery key from the old installation, but not sure how I can use it here.

There is not a prompt for the recovery key when using the incus admin recover command:

❯ incus admin recover
This server currently has the following storage pools:
 - local (backend="zfs", source="local/incus")
Would you like to recover another storage pool? (yes/no) [default=no]: yes
Name of the storage pool: incus02pool01/main
Name of the storage backend (btrfs, dir, lvm, lvmcluster, zfs): zfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): incus02pool01/main
Additional storage pool configuration property (KEY=VALUE, empty when done):
Would you like to recover another storage pool? (yes/no) [default=no]:
The recovery process will be scanning the following storage pools:
 - EXISTING: "local" (backend="zfs", source="local/incus")
 - NEW: "incus02pool01/main" (backend="zfs", source="incus02pool01/main")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]: yes
Scanning for unknown volumes...
Error: Failed validation request: Failed checking volumes on pool "incus02pool01/main": Failed to activate volume: Failed to locate zvol for "incus02pool01/main/virtual-machines/frigate260704.block": context deadline exceeded

While exploring other options, I found the incus admin os system storage import-storage-pool command. I believe I have the command syntax correct:

❯ incus admin os system storage import-storage-pool  --data '{"type":"zfs","name":"incus02pool01","encryption_key":"rajwcvwk-iopszcqz-zciauzvb-jiymnkuk-dmoribst-dlnuoqih-qwdblari-ltwqsqfl"}'
WARNING: The IncusOS API and configuration is subject to change

Error: illegal base64 data at input byte 8

Same error is displayed when attempting to use the GUI for this:

Import pool failed

illegal base64 data at input byte 8

Thanks for reading my post! If you have any idea how to proceed here, then please let me know.

Solved the problem. :slight_smile: My mistake was using the TPM encryption recovery key instead of the pool recovery key. This is what a correct command looks like:

~
❯ KEY="grsQ/+AP7MST8T0yiAMlcmwTyl+aQyUfxA53vjUbjZg="

~
❯ incus admin os system storage import-storage-pool --data "{\"type\":\"zfs\",\"name\":\"incus02pool01\",\"encryption_key\":\"${KEY}\"}"
WARNING: The IncusOS API and configuration is subject to change

The pool recovery keys are shown below the TPM encryption recovery key as part of the OS system security data from the old IncusOS system:

config:
  encryption_recovery_keys:
    - rajwcvwk-iopszcqz-zciauzvb-jiymnkuk-dmoribst-dlnuoqih-qwdblari-ltwqsqfl
state:
  encrypted_volumes:
    - volume: root
      state: unlocked (TPM)
    - volume: swap
      state: unlocked (TPM)
  encryption_recovery_keys_retrieved: true
  drive_recovery_keys: {}
  pool_recovery_keys:
    incus02pool01: grsQ/+AP7MST8T0yiAMlcmwTyl+aQyUfxA53vjUbjZg=
    local: ZRrrznk6YVHzIDgOeuSYRz3iQKB5fhzcc0XnRe5fKP0=
...

Note: None of those are my actual keys.

After succeeding with the ZFS pool import, I was able to complete the recovery using the incus admin recover command. The output is shown below:

❯ incus admin recover
This server currently has the following storage pools:
 - local (backend="zfs", source="local/incus")
Would you like to recover another storage pool? (yes/no) [default=no]: yes
Name of the storage pool: main
Name of the storage backend (dir, lvm, lvmcluster, zfs, btrfs): zfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): incus02pool01/main
Additional storage pool configuration property (KEY=VALUE, empty when done):
Would you like to recover another storage pool? (yes/no) [default=no]: no
The recovery process will be scanning the following storage pools:
 - EXISTING: "local" (backend="zfs", source="local/incus")
 - NEW: "main" (backend="zfs", source="incus02pool01/main")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]: yes
Scanning for unknown volumes...
The following unknown storage pools have been found:
 - Storage pool "main" of type "zfs"
The following unknown volumes have been found:
 - Volume "images" on pool "main" in project "default" (includes 0 snapshots)
 - Virtual-Machine "frigate260704" on pool "main" in project "default" (includes 0 snapshots)
 - Volume "backups" on pool "main" in project "default" (includes 0 snapshots)
Would you like those to be recovered? (yes/no) [default=no]: yes
Starting recovery...