Restoring large (1.4GB) postgres backup using powershell encounters System.OutOfMemoryException
#14619
Closed
1 of 3 tasks
System.OutOfMemoryException
#14619
The bug
I tried following the procedure described in the documentation (https://immich.app/docs/administration/backup-and-restore/) to manually restore a backup of the postgres database. Note that I'm on windows, hence I've tried the described procedure for the powershell.
However at the step where one is to restore the database using the .sql file, the documentation states that one should use
gc "C:\path\to\backup\dump.sql" | docker exec -i immich_postgres psql --username=postgres
.This then errors in my case with a
System.OutOfMemoryException
:I assume this is due to powershells
Get-Content
not being capable of handling the 1.4GB .sql file due to its size. The powershell in which it was ran occupied (after encountering the exception) something like 8GB in task manager, so much more than the actual restoration file.Note that my system had 16 GB of RAM to work with out of a total of 32GB, so in theory it should be able to read the entire file into memory, so I do not know why it is struggling so much.
Also note: I've managed to restore the database by manually removing offending files (and it seems to work again), so while it is not critical for me right now, it would be nice to have a working backup + restoration strategy.
The OS that Immich Server is running on
Windows 11 version 23H2
Version of Immich Server
v1.122.2
Version of Immich Mobile App
N/A
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
gc "C:\path\to\backup\dump.sql" | docker exec -i immich_postgres psql --username=postgres
Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: