Importing an Immich DB backup into a new CNPG database
- Create the new Immich database
kubectl cnpg -n databases psql <db name> -- -c 'CREATE DATABASE immich;'
- Ensure that you're woring with the primary CNPG instance
kubectl cnpg -n databases status <db name> | grep "Primary instance:"
- Run the Immich restore command
gunzip < "immich-db-backup-1735455600013.sql.gz"| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" | kubectl cnpg -n databases psql <db name> --