Restoring Immich From Backup
Hello, I am currently attempting to restore immich from a backup, but running into some issues with some of the restore commands not working.
61 Replies
:wave: Hey @Nathan Hoffman,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.I am restoring from an older big-bear backup into the latest version of immich. I have both my database file and my upload folder contents
I have no issue getting up to docker compose create, but after that point, I don't think the commands are working properally
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
im just restarting from scratch real quick and will send the results to all of the commands.
I am running all commands in /var/lib/casaos/apps/immich because that's where my compose is
Docker compose down -v
rm -rf /DATA/AppData/immich/pgdata - worked
docker compose pull
docker compose create
here is the first issue
when I do docker start immich-postgres, it just constantly shows as starting in portrainer
when I look at the logs this is what happened
is this an issue or normal since I deleted the database file in pgdata
@Mraedis would you mind helping out
I believe you are knowledgable on casa right?
No need to ping specific people, plenty of us can help
Does the database shut down every time or was it just once? I don't entirely understand what the issue is
every time
I stop/start immich-postgres but nothing changes
and the status changes to unhealthy not starting
What does
docker compose ps
output?
Also check the log
folder inside the postgres data dir, that should have more database logs
first log is this
second and 3rd log files are identical and this
Strange
Can you post your compose and .env?
ok
compose
where can I find the env?
The healthcheck for your immich Postgres is missing the second $ signs
ok
I ive done up to the step where it says Populate the .env file with custom values
what should I do
how do I fix this
You can probably do the pull and create next
ok
even though I already have immich installed I should do it again?
finished pulling
finished creating
also did this change the location of my docker compose
Uh that’s up to you
Your first compose was broken so that’s why Postgres wasn’t healthy
ok so now it should be healthy and I can continue with restore?
this command just sits there and doesnt really do anything, ive waited very long
am I suppost to run some of the commands in the docker container and not in the cmd line
That’s not a command by itself. You’re missing characters from the instructions to turn it into one line
It should go between the gunzip and the docker exec
ahh I just ran all three together and it worked
is it dangerous to start all of my containers before I move over the upload folder?
It’s not dangerous but it will refuse to start
ok, because last time it worked and I saw all of my pictures, except I couldn't actually see them just like the database info
Hm. That would surprise me if it started at all
ok
last question
when im uploading my backup, I have 5 files. encoded video, thumbs, profile, library, and upload
do they all go into my /immich directory or should I put them all inside of /immich/upload
What’s your upload location. Set to
./library
The 5 folders should go into that folder then
ok
but im not exactly sure where that is
would it just be in root?
Uh, it’s wherever your compose file is I guess. You can start the stack and it should at least make the library folder
ok, I will try that, but that's not how my setup had used to work since on casa compose files are inside var/lib/casaos/apps/immich
You can set upload_location to wherever those folders are now
just like the full path anywhere on the system?
Mhm
ok thanks
finished moving upload folder, getting this error in immich-server and now cannot access the webserver.
you have not moved the files back to the correct location
All of my files have been uploaded to /immich-app/library
Is that not where they’re supposed to be
I figured it had to be since it auto generated the “library folder” on start up
currently testing what happens if i just ignore mount checks
it worked
I guess a permenant solution would just be manually creating .immich files
You should only do either of those things if you're absolutely certain all the files are where they should be
If not, you will probably lose data
right now everything works as normal, I can upload, download and see my entier library
so is it safe to proceed?
Well, are you absolutely certain everything is where it should be?
considering it works, yes
But you said you're ignoring the mount checks, right? That'd be why it works
right but if I can upload/download, and see all content, then wouldn't everything need to be in the right place, otherwise, wouldn't the functionality break
the only probelm I noticed is during large upload chucks, the immich-server container will periodically crash and come back online which is slightly annoying
here is the error I get when that happens
im not exactly sure what can be done to make the .immich file checks work, but do you think that these two issues could be related?
To reiterate, needing to set that env var itself means your install is broken. We do not help debug installs with that enabled
I recommend looking into the folders, specifically the encoded video folder and post the contents of each folder here for further checking
ok
would it be easier if I just sent the tree?
Can you use -a ?
To show hidden files
/immich-app/
├── docker-compose.yml
├── .env
├── library
│ ├── backups
│ │ └── .immich
│ ├── encoded-video
│ │ ├── 13b14327-430f-4cd3-9f54-64f1157edcb3
│ │ ├── 1f992bb2-1a87-460c-84ad-acdc66a344b9
│ │ ├── af4c5dd7-b430-450e-8ff2-666299c67af1
│ │ ├── b60ae4e7-289d-4627-81e9-a90c6b36a680
│ │ └── .immich
│ ├── library
│ ├── profile
│ │ └── af4c5dd7-b430-450e-8ff2-666299c67af1
│ ├── thumbs
│ │ ├── 13b14327-430f-4cd3-9f54-64f1157edcb3
│ │ ├── 1f992bb2-1a87-460c-84ad-acdc66a344b9
│ │ ├── af4c5dd7-b430-450e-8ff2-666299c67af1
│ │ └── b60ae4e7-289d-4627-81e9-a90c6b36a680
│ └── upload
│ ├── 13b14327-430f-4cd3-9f54-64f1157edcb3
│ ├── 1f992bb2-1a87-460c-84ad-acdc66a344b9
│ ├── af4c5dd7-b430-450e-8ff2-666299c67af1
│ └── b60ae4e7-289d-4627-81e9-a90c6b36a680
└── postgres [error opening dir]
I believe I manually created the .immich file in encoded video
not the one in backups though
You have a lot of hidden files missing
How did you move the folders?
I just uploaded them via winSCP using only new/updated files
Oh I’m thinking that skips hidden files the.
so schould I just go ahead and manually create them
I guess if all is working well I would make the .immich file in each folder
I don’t think we have any other hidden files in immich
ok
The Postgres folder may be concerning
But I guess if the DB is running fine it’s ok
it could just be that it's currently being written to or something as im backing up two phones at the moment
but one other concern i have is that immich auto generated the /library file inside of the pre-existing one
is it possible that my folders are actually suppost to me in immich-app/library/library
That’s normal
ok thx
If you enable the storage template the files wi go in library/library
I wouldn’t use win SCP for anything like this in the future
Use rsync
ok thanks
I'm going to wait for the phones to finish backing up but later tonight I will add .immich files to the folders and remove the ignore .immich checks env variable
then update with what happens
thanks for the hlep
still not sure why server periodically crashes during uploads though
What’s the specs
Of the server?
It’s running like an i5 and 12gb of ram with 2hhds