Issue with Restore on ubuntu

I was running immich on windows docker desktop, and I've just setup an Ubuntu machine. I ran the backup command as listed in the docs, and then I transferred the dump.sql.gz file to the ubuntu machine. When I try to restore the postgres server I get this error below:
$ gunzip < "/mnt/sda-samsung/dump.sql.gz" | docker exec -i immich_postgres psql -U postgres -d immich

$ gzip: stdin: not in gzip format
Error response from daemon: Container 2c71b62bac5e9dbc98487b38eda69a46c9426e7151e208170822d793a1a05247 is not running
$ gunzip < "/mnt/sda-samsung/dump.sql.gz" | docker exec -i immich_postgres psql -U postgres -d immich

$ gzip: stdin: not in gzip format
Error response from daemon: Container 2c71b62bac5e9dbc98487b38eda69a46c9426e7151e208170822d793a1a05247 is not running
I'm checking the file type and it says that it's data
$ file dump.sql.gz
dump.sql.gz: data
$ file dump.sql.gz
dump.sql.gz: data
Please can anyone offer some advice on what I should do?
4 Replies
jrasm91
jrasm912y ago
What command did you use to generate the backup? You can also skip the whole gzip part if that is complicated going between windows/linux Is that container 2c71b... on windows or Linux? That's not the actual content is it?
rypudding
rypuddingOP2y ago
I used docker exec -t immich_postgres pg_dumpall -c -U postgres | gzip > "/path/to/backup/dump.sql.gz" to generate it on windows so like you said I've tried skipping the gzip part I've now used 7zip to compress it into gzip format, and I've transferred to my ubuntu machine but on linux I'm getting the Error response from daemon: Container 2c71b62bac5e9dbc98487b38eda69a46c9426e7151e208170822d793a1a05247 is not running error still when i ran docker start immich_postgres I got this error:
Error response from daemon: network immich-app_default not found
Error: failed to start containers: immich_postgres
Error response from daemon: network immich-app_default not found
Error: failed to start containers: immich_postgres
immich@immich:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
df51e15c4b9b ghcr.io/immich-app/immich-proxy:release "/docker-entrypoint.…" 32 minutes ago Created immich_proxy
30b22c777d3e ghcr.io/immich-app/immich-server:release "/bin/sh start.sh im…" 32 minutes ago Created immich_server
df73e5992097 ghcr.io/immich-app/immich-server:release "/bin/sh start.sh mi…" 32 minutes ago Created immich_microservices
2c71b62bac5e postgres:14-alpine "docker-entrypoint.s…" 32 minutes ago Created immich_postgres
21ce4387acfe redis:6.2-alpine "docker-entrypoint.s…" 32 minutes ago Created immich_redis
5da3508e42fc typesense/typesense:0.24.1 "/opt/typesense-serv…" 32 minutes ago Created immich_typesense
914bcee0813e ghcr.io/immich-app/immich-web:release "/bin/sh entrypoint.…" 32 minutes ago Created immich_web
86d38cf61427 ghcr.io/immich-app/immich-machine-learning:release "python main.py" 32 minutes ago Created immich_machine_learning
immich@immich:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
df51e15c4b9b ghcr.io/immich-app/immich-proxy:release "/docker-entrypoint.…" 32 minutes ago Created immich_proxy
30b22c777d3e ghcr.io/immich-app/immich-server:release "/bin/sh start.sh im…" 32 minutes ago Created immich_server
df73e5992097 ghcr.io/immich-app/immich-server:release "/bin/sh start.sh mi…" 32 minutes ago Created immich_microservices
2c71b62bac5e postgres:14-alpine "docker-entrypoint.s…" 32 minutes ago Created immich_postgres
21ce4387acfe redis:6.2-alpine "docker-entrypoint.s…" 32 minutes ago Created immich_redis
5da3508e42fc typesense/typesense:0.24.1 "/opt/typesense-serv…" 32 minutes ago Created immich_typesense
914bcee0813e ghcr.io/immich-app/immich-web:release "/bin/sh entrypoint.…" 32 minutes ago Created immich_web
86d38cf61427 ghcr.io/immich-app/immich-machine-learning:release "python main.py" 32 minutes ago Created immich_machine_learning
immich@immich:~$ docker start 2c71b62bac5e
Error response from daemon: network immich-app_default not found
Error: failed to start containers: 2c71b62bac5e
immich@immich:~$ docker start immich_postgres
Error response from daemon: network immich-app_default not found
Error: failed to start containers: immich_postgres
immich@immich:~$ docker start 2c71b62bac5e
Error response from daemon: network immich-app_default not found
Error: failed to start containers: 2c71b62bac5e
immich@immich:~$ docker start immich_postgres
Error response from daemon: network immich-app_default not found
Error: failed to start containers: immich_postgres
not sure what is causing the network immich-app_default not found to happen
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
8ec7faedcfc5 bridge bridge local
1ef666fe06c8 host host local
e854c940d942 none null local
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
8ec7faedcfc5 bridge bridge local
1ef666fe06c8 host host local
e854c940d942 none null local
jrasm91
jrasm912y ago
The restore command doesn't have to go through gunzip either btw. i think you can just cat it into the container as well. But it looks like you just need to get the container up and running first. Can you post your compose file? Instead of docker start postgres can you try docker compose up database?
rypudding
rypuddingOP2y ago
Ok docker-compose up database did the trick! Looks like everything else went ok. Thanks so much for your help

Did you find this page helpful?