[GH-ISSUE #11677] [Improvement/immich] Backup database before upgrade #2459

Closed
opened 2026-02-26 12:52:31 +03:00 by kerem · 8 comments
Owner

Originally created by @louanrobert on GitHub (Feb 7, 2026).
Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/11677

Originally assigned to: @vhsdream on GitHub.

🌟 Briefly describe the feature

Before upgrading, backup the postgres database by using the immich backup job or pg_dump

📝 Detailed description

Before proceeding with the upgrade, create a backup of the PostgreSQL database.
The upgrade process may break the installation and need a fresh install or include database schema changes or migrations that are not reversible, and a failed or interrupted upgrade could lead to data loss or corruption.

I see 2 options:

Option 1: Immich backup job

Use the built-in Immich backup job to create a full database backup.
Porbably the cleanest. Only question is how to trigger and wait for the upgrade this way ?

Option 2: Manual backup using pg_dump

Alternatively, we can manually export the database using pg_dump:

Make sure the backup file is successfully created

💡 Why is this useful?

Definitely fewer headaches.

Originally created by @louanrobert on GitHub (Feb 7, 2026). Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/11677 Originally assigned to: @vhsdream on GitHub. ### 🌟 Briefly describe the feature Before upgrading, backup the postgres database by using the immich backup job or pg_dump ### 📝 Detailed description Before proceeding with the upgrade, create a backup of the PostgreSQL database. The upgrade process may break the installation and need a fresh install or include database schema changes or migrations that are not reversible, and a failed or interrupted upgrade could lead to data loss or corruption. I see 2 options: Option 1: Immich backup job Use the built-in Immich backup job to create a full database backup. Porbably the cleanest. Only question is how to trigger and wait for the upgrade this way ? Option 2: Manual backup using pg_dump Alternatively, we can manually export the database using pg_dump: Make sure the backup file is successfully created ### 💡 Why is this useful? Definitely fewer headaches.
kerem 2026-02-26 12:52:31 +03:00
Author
Owner

@MickLesk commented on GitHub (Feb 7, 2026):

From what are you talking? We have 450 Scripts. Are you only talking about immich, in which Case?

Updates are full User Input. If an User dont create snapshots = Shit Happens. Every big Update should be snapshotted before.

<!-- gh-comment-id:3865531768 --> @MickLesk commented on GitHub (Feb 7, 2026): From what are you talking? We have 450 Scripts. Are you only talking about immich, in which Case? Updates are full User Input. If an User dont create snapshots = Shit Happens. Every big Update should be snapshotted before.
Author
Owner

@louanrobert commented on GitHub (Feb 7, 2026):

I'm only talking about immich here.

From my perspective, it wouldn't be that difficult to do a pg_dump before updating and probably save some headaches.

But yeah, this could be applied to all scripts that use PostgreSQL.

<!-- gh-comment-id:3865543585 --> @louanrobert commented on GitHub (Feb 7, 2026): I'm only talking about immich here. From my perspective, it wouldn't be that difficult to do a pg_dump before updating and probably save some headaches. But yeah, this could be applied to all scripts that use PostgreSQL.
Author
Owner

@MickLesk commented on GitHub (Feb 7, 2026):

I don't see it that way. A dump is generated when psql versions change, but not with every update. Snapshots or vzdumps are used for updates. Those who don't do this will have to learn when something breaks. No one of normal homelab users can do anything with a dump. If an update fails, it has failed, and a simple dump is useless without massive manual intervention. The only way is to make proper backups.

<!-- gh-comment-id:3865558595 --> @MickLesk commented on GitHub (Feb 7, 2026): I don't see it that way. A dump is generated when psql versions change, but not with every update. Snapshots or vzdumps are used for updates. Those who don't do this will have to learn when something breaks. No one of normal homelab users can do anything with a dump. If an update fails, it has failed, and a simple dump is useless without massive manual intervention. The only way is to make proper backups.
Author
Owner

@louanrobert commented on GitHub (Feb 7, 2026):

I don't agree. Immich is doing daily backups with pg_dump and restore is fully supported. Furthermore, on small homelabs with limited drive capacity, backing up immich could be difficult.

<!-- gh-comment-id:3865577080 --> @louanrobert commented on GitHub (Feb 7, 2026): I don't agree. Immich is doing daily backups with pg_dump and restore is fully supported. Furthermore, on small homelabs with limited drive capacity, backing up immich could be difficult.
Author
Owner

@MickLesk commented on GitHub (Feb 7, 2026):

@vhsdream 🤷🏼‍♂️ useless request in my opinion

Requester is also not responding to my snapshot/vzdumps message. I don't feel like responding any further.

<!-- gh-comment-id:3865588133 --> @MickLesk commented on GitHub (Feb 7, 2026): @vhsdream 🤷🏼‍♂️ useless request in my opinion Requester is also not responding to my snapshot/vzdumps message. I don't feel like responding any further.
Author
Owner

@louanrobert commented on GitHub (Feb 8, 2026):

Let's just close this issue. The way you speak is not at all collaborative. You seem very set in your ways. This seems very far removed from my view of the “homelab” community. Users that uses these scripts are not professional.

I am a computer scientist myself, without claiming to be an advanced Proxmox user, and I was caught out by an update that created permission issues. I managed to fix the problem, but I think someone with a little less experience would have struggled.

I am unable to perform vzdumps of immich due to a lack of disk space (as already mentioned). I looked at the inner workings of snapshots, and it is probably the solution to the lack of space.

By the way, other scripts are doing backups (not specifically of databases, though).

<!-- gh-comment-id:3866653336 --> @louanrobert commented on GitHub (Feb 8, 2026): Let's just close this issue. The way you speak is not at all collaborative. You seem very set in your ways. This seems very far removed from my view of the “homelab” community. Users that uses these scripts are not professional. I am a computer scientist myself, without claiming to be an advanced Proxmox user, and I was caught out by an update that created permission issues. I managed to fix the problem, but I think someone with a little less experience would have struggled. I am unable to perform vzdumps of immich due to a lack of disk space (as already mentioned). I looked at the inner workings of snapshots, and it is probably the solution to the lack of space. By the way, other scripts are doing backups (not specifically of databases, though).
Author
Owner

@MickLesk commented on GitHub (Feb 8, 2026):

Ok.

<!-- gh-comment-id:3866828550 --> @MickLesk commented on GitHub (Feb 8, 2026): Ok.
Author
Owner

@tremor021 commented on GitHub (Feb 8, 2026):

@louanrobert

Let's just close this issue. The way you speak is not at all collaborative. You seem very set in your ways. This seems very far removed from my view of the “homelab” community. Users that uses these scripts are not professional.

You've been given advice what to do and your issue is avoided by doing snapshots like we all do.
Not having enough space is really something you should think about ahead of time. Backups and snapshots are integral part of Proxmox and should be thought about and used all the time and planned for.

I am a computer scientist myself, without claiming to be an advanced Proxmox user, and I was caught out by an update that created permission issues. I managed to fix the problem, but I think someone with a little less experience would have struggled.

Also avoided by having snapshots. You solved it by knowing what you're doing, the ones who don't know what they're doing should restore from snapshot and seek help online.

I am unable to perform vzdumps of immich due to a lack of disk space (as already mentioned). I looked at the inner workings of snapshots, and it is probably the solution to the lack of space.

Yes, snapshots should be taken before any update as 99.9% of you, and by you i mean users, don't ever bother to read changelogs and dont understand what those changes can break, hence why snapshots are essential

By the way, other scripts are doing backups (not specifically of databases, though).

Correct, if we indentify that a database upgrade is breaking stuff, we will performa a backup. Or if the developer specificaly states that upgrading the application is done by taking the backup and restoring it later

<!-- gh-comment-id:3866880919 --> @tremor021 commented on GitHub (Feb 8, 2026): @louanrobert >Let's just close this issue. The way you speak is not at all collaborative. You seem very set in your ways. This seems very far removed from my view of the “homelab” community. Users that uses these scripts are not professional. You've been given advice what to do and your issue is avoided by doing snapshots like we all do. Not having enough space is really something you should think about ahead of time. Backups and snapshots are integral part of Proxmox and should be thought about and used all the time and planned for. >I am a computer scientist myself, without claiming to be an advanced Proxmox user, and I was caught out by an update that created permission issues. I managed to fix the problem, but I think someone with a little less experience would have struggled. Also avoided by having snapshots. You solved it by knowing what you're doing, the ones who don't know what they're doing should restore from snapshot and seek help online. >I am unable to perform vzdumps of immich due to a lack of disk space (as already mentioned). I looked at the inner workings of snapshots, and it is probably the solution to the lack of space. Yes, snapshots should be taken before any update as 99.9% of you, and by you i mean users, don't ever bother to read changelogs and dont understand what those changes can break, hence why snapshots are essential >By the way, other scripts are doing backups (not specifically of databases, though). Correct, if we indentify that a database upgrade is breaking stuff, we will performa a backup. Or if the developer specificaly states that upgrading the application is done by taking the backup and restoring it later
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#2459
No description provided.