Backup and Restore Immich from TrueNAS Scale to Docker using pg_dumpall #10906
Replies: 2 comments 5 replies
-
Hello there. |
Beta Was this translation helpful? Give feedback.
-
Hey @ra7bi , thanks for this excellent guide! There are a couple of steps that I'm a little unclear about, and I'm wondering if they're even required, given the way that I setup Immich initially (using 7 separate datasets via HostPaths per the community guide here.). Since my database is relatively easily accessible inside the pgData dataset (I can mount via SMB to copy it), do I have to do the steps of "dump"ing the database? Can I simply copy the library/upload/profile folders and put those 3 folders under UPLOAD_LOCATION=/path_to_backupLibrary, and then copy the pgData folder to DB_DATA_LOCATION=./postgres and update the .env file with these paths? Or would this not be sufficient? Sorry, I'm just a little n00b with the command line and try to avoid it when I can lol. |
Beta Was this translation helpful? Give feedback.
-
Backup and Restore Immich from TrueNAS Scale to Docker
This guide will walk you through the steps to backup your Immich database and relevant folders from a TrueNAS Scale environment and restore them to a Docker-based system.
Backup Immich Database and Folders from TrueNAS Scale
SSH into your TrueNAS Scale server:
Get the PostgreSQL pod name:
Look for the pod name that starts with
immich-postgres
.Dump the PostgreSQL database:
Move the dump file to a desired location:
Copy the required folders:
Download the dump file and backupLibrary folder to your local machine:
Use
scp
or any other method to download the dump file and backupLibrary folder to your local machine.Restore Immich Database and Folders on Docker
Copy the backupLibrary folder to your new Docker server:
Use
scp
or any other method to upload the backupLibrary folder to your new Docker server.Download and set up Immich on your Docker server:
Follow the Immich Docker installation guide to download and set up Immich.
Update the
UPLOAD_LOCATION
in your.env
file:Set the
UPLOAD_LOCATION
to point to thebackupLibrary
folder:Check the PostgreSQL version in TrueNAS Scale:
Make sure the version matches with the PostgreSQL version in your Docker setup. If not, update your Docker YAML file to match the PostgreSQL version.
Prepare the dump file:
Notes
<immich-postgres-pod-name>
with the actual PostgreSQL pod name obtained in step 2./home/xxxx
with the actual path where you want to move the dump file./path_to_backupLibrary
with the actual path to thebackupLibrary
folder on your Docker server.sed
andgzip
installed on your local machine for processing the dump file.This guide should help you smoothly backup and restore your Immich database and relevant folders between TrueNAS Scale and any Docker-based system. If you encounter any issues, please refer to the relevant PostgreSQL and Docker documentation for further assistance.
Thanks you
Beta Was this translation helpful? Give feedback.
All reactions