Restoring backups from database snapshots fails due to vectors, users, restricted #7909

Closed
opened 2026-02-05 13:24:21 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @nileshp87 on GitHub (Nov 23, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

I have resolved this issue, but making an issue as the docs don't cover this scenario. I'm hoping it might help someone who finds themselves in a similar spot.

My kubernetes cluster had a catastrophic failure, I'm running with cnpg, and I recently (~2 months ago) went through the pain of upgrading through the vectors issue.

Part of my catastrophic failure involved having to redo the database and losing my other backup methods.

Luckily, immich takes regular snapshots, however when applying them to a new database, I got a bunch of errors around vectors and others.

If you find yourself in this situation, download your backup.sql.gz file locally, and run gunzip on it.

Open it in your editor (vscode worked for me, my file was ~70MB, yours may be larger and require some other method).

You can safely remove lines relating to:

  • restrict
  • unrestrict
  • vectors (note the plural, referencing vecto.rs, NOT vector)

Because my users etc. changed, I also had to:

  • remove lines relating to the old user
  • remove lines relating to the streaming users (cnpg account)

You should now be able to apply the sql file following the insructions in the immich docs (here)[https://docs.immich.app/administration/backup-and-restore/].

My DB name changed from immich -> app. You can safely change the dbname in psql as well via manual changes. Note that the --dbname flag in psql will not do this for you.

Finally, ensure whatever user you're using is a superuser, and you'll need to update their password back to your new cnpg's cluster's expected password that's stored in the secret.

The OS that Immich Server is running on

Docker

Version of Immich Server

v2.1.3

Version of Immich Mobile App

n/a

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

No response

Your docker-compose.yml content

n/a

Your .env content

n/a

Reproduction steps

n/a

Relevant log output


Additional information

No response

Originally created by @nileshp87 on GitHub (Nov 23, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug I have resolved this issue, but making an issue as the docs don't cover this scenario. I'm hoping it might help someone who finds themselves in a similar spot. My kubernetes cluster had a catastrophic failure, I'm running with cnpg, and I recently (~2 months ago) went through the pain of upgrading through the vectors issue. Part of my catastrophic failure involved having to redo the database and losing my other backup methods. Luckily, immich takes regular snapshots, however when applying them to a new database, I got a bunch of errors around vectors and others. If you find yourself in this situation, download your backup.sql.gz file locally, and run `gunzip` on it. Open it in your editor (vscode worked for me, my file was ~70MB, yours may be larger and require some other method). You can safely remove lines relating to: - restrict - unrestrict - vectors (note the plural, referencing vecto.rs, NOT vector) Because my users etc. changed, I also had to: - remove lines relating to the old user - remove lines relating to the streaming users (cnpg account) You should now be able to apply the sql file following the insructions in the immich docs (here)[https://docs.immich.app/administration/backup-and-restore/]. My DB name changed from immich -> app. You can safely change the dbname in psql as well via manual changes. Note that the `--dbname` flag in psql will not do this for you. Finally, ensure whatever user you're using is a superuser, and you'll need to update their password back to your new cnpg's cluster's expected password that's stored in the secret. ### The OS that Immich Server is running on Docker ### Version of Immich Server v2.1.3 ### Version of Immich Mobile App n/a ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Device make and model _No response_ ### Your docker-compose.yml content ```YAML n/a ``` ### Your .env content ```Shell n/a ``` ### Reproduction steps n/a ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@nileshp87 commented on GitHub (Nov 23, 2025):

Closing this issue, though it might be good to update docs with some of this.

@nileshp87 commented on GitHub (Nov 23, 2025): Closing this issue, though it might be good to update docs with some of this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#7909