September 4, 2025Sep 4 Hello!I am running UnRaid 7.1.3 on an old Synology NAS.Somehow, messing around with my Docker settings, I managed to mess up my Immich installation - Immich opens, but it had me set a new admin account, etc. All of my media still exists locally and on my backup drives, as does the automatic backup file from Immich. I would like to run the backup script from Immich, as seen below and in their page about backups:docker compose down -v # CAUTION! Deletes all Immich data to start from scratch## Uncomment the next line and replace DB_DATA_LOCATION with your Postgres path to permanently reset the Postgres database# rm -rf DB_DATA_LOCATION # CAUTION! Deletes all Immich data to start from scratchdocker compose pull # Update to latest version of Immich (if desired)docker compose create # Create Docker containers for Immich apps without running themdocker start immich_postgres # Start Postgres serversleep 10 # Wait for Postgres server to start up# Check the database user if you deviated from the defaultgunzip --stdout "/path/to/backup/dump.sql.gz" \| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \| docker exec -i immich_postgres psql --dbname=postgres --username=<DB_USERNAME> # Restore Backupdocker compose up -d # Start remainder of Immich appsThe embarrassing question is, where do I input this in Unraid? I built Immich using the Docker Compose Method and while I have a command line input for the immich_server docker application I don't know if it has access to the area where the backup files are generated.Thank you!
September 4, 2025Sep 4 Solution see guides post for CA and ComposeDocker Guides:Immich Docker-compose SetupImmich Unraid-Template in the CAPlease ask questions here.looks like you went Compose route...you will need to install the unraid CA Postgres docker and restore your previous postgress database. then update immich to the docker appdata path for immich.*once you restore the database, the previous immich passord will be needed to connect to the database...SO, essential install the immich postgress docker I made in the CA.Run your tools and commands to restore your postgress.stop the CA docker and add your compose file editing the path to reuse the CA docker data...-You are responsible for your own data! Edited September 4, 2025Sep 4 by bmartino1 -You are responsible for your own data!
September 5, 2025Sep 5 Author @bmartino1 Thank you for your help as well as your work on this project. Please bear with me as I ask a few more questions - I am not smart.When you advise me to "Run your tools and commands to restore your postgres" - going through the documentation, I believe what I need to do is input the commandgunzip < your_dump.sql.gz | docker exec -i your-db-container psql -U your-db-user -d your-db-namewith my backup, container, etc. information filled in. However, I don't know where to input this. I can open a console to Immich_PostgreSQL but when I input a command with "docker" in it it tells me docker is not found. Should I be using the unraid web terminal?Thank you!
September 5, 2025Sep 5 kinda.following the documentation from immichyou will need some form of terminal access. First I recommend adding a data path to the docker. I will use unraid CA examples atm...so in the web UI. click the dokcer and edit the docker scrool to the very bottom andadd a pathlink /backup to the path of your immich folder that has the Postgres restore file.*This is needed later to use the docker commands and to bring files into the secure container docker environment.This will make a /backup folder that points to the immich backup that holds the Postgres data we want to restore.so with a Postgres setup, and the docker running:you can click on the docker and go to console.This should open a terminal window as if you are at a ssh connection on the machine that is the docker.here, you need to have a path to the restore file added to the docker. example ls to see folders (*Note this Doesn't have the backup path made above... just example you should see a backup or what ever you called the container path...)it is here that you run sql and other commands to connect to postgres and run the needed commands to restore the backup...#####################################With that out of the way...Why Kinda... So yes. You will need unraid terminal access. However, There are many ways to accomplish the same thing. As The goal here is to get access to a terminal that can connect to the Postgres database to write a sql file to replace and update the database running to restore from a backup.Other software and dockers exist that can connect to Postgres to run the sql backed up file to restore the database...So now lets review the immich documentation... Immich from command line since Postgres is a docker we use docker tools and on unraid host(we open the web terminal) we would execute something like this:docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=<DB_USERNAME> | gzip > "/path/to/backup/dump.sql.gz"Learn more on docker execute here:Docker Documentationdocker container exechere, the command is ran to dump the current Postgres database in a docker named immich_postgress. pg_dump is the Postgres command to dump the database to a text file.Now the other half... if gzip the linux application is installed as database can grow big. it will attempt to compress and make the sql file smaller.*last i checked, gzip is not a default unraid package and thus ignored the command will fail... you will have a sql file on unrad wher you ran the docker exe command.... However, You can use other tools as well to extract the zip file to get the sql file you need to restore... or compress.so from the documentation ocne you have the sql file we can then use terminal commands to restoredocker exec -i immich_postgres psql --dbname=postgres --username=<DB_USERNAME> # Restore Backupthis restores the sql file to a database named postgres.as again many ways to accomplish it..Postgres's comandshttps://www.youtube.com/watch?v=5kPFhTqlRIEhttps://www.youtube.com/watch?v=QcZHk70CK0oand as some what explained here in documentation:as you will need to get a blank postgress database working with the correct database name and user credential and then run a restore command to get your old sql file on the new Postgres.Then use the data folder and same docker image in the compose file to reuse your restore.we can also take a look at Postgres admin docker called pgadmin4https://hub.docker.com/r/dpage/pgadmin4/if your not comfortable running terminal commands.or other 3rd party applicaiton antraes for examplehttps://antares-sql.app/that can connect to portgres for use to run the sql file... Edited September 5, 2025Sep 5 by bmartino1 Spelling / Data
September 7, 2025Sep 7 Author Thank you so much for bearing with me @bmartino1 ! I was able to get everything restored thanks to your help and the documentation you provided, and it also cleared up a lot of misconceptions I had about how docker works. Thank you again!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.