Run initial migration processing off the RPi
If there are a lot of files that need to be migrated, the initial CPU intensive processes might cause the RPi to overheat and shutdown. To avoid this, we will spin up an immich server instance on a more powerful machine, such as a laptop/desktop, using the same external hard disk used for the RPi. Media assets are then imported to this local server for processing. Once finished, we will use the external drive in our RPi server setup.
- Follow setup step 1 to encrypt the external drive.
- Mount the encrypted drive to your machine.
- Use
lsblkto get the mount point path to the drive. - Create a
.envfile containing the snippet content below.- Change the DRIVE_PATH the to mount point path of the external drive.
- Change the DB_PASSWORD.
Caution
Securely store the
DB_PASSWORD. This is necessary to recover the database which is essential to make sense of our backup.
# Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=changeThisPassword # The path to the root of your external drive DRIVE_PATH=/run/media/<user>/immich_drive # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v2.1.0" IMMICH_VERSION=v2 # Do not change the following values ################################################################################### # The location where your uploaded files are stored UPLOAD_LOCATION=${DRIVE_PATH}/immich_data # The location where your database files are stored. DB_DATA_LOCATION=${DRIVE_PATH}/postgres_not_rpi DB_USERNAME=immich # set to `immich` to match the hardcoded user set in the nix immich service. DB_DATABASE_NAME=immichNote
It may be possible to use the
UPLOAD_LOCATIONandDB_DATA_LOCATIONdirectories generated by your machine on the RPi. However, this is likely to be a smooth transition only if you are creating your immich instance on another NixOs with the same version of immich and postgres. - Follow immich instructions to setup an immich instance on your machine with the newly created
.envfile. - Migrate your photos and videos.
- Create a backup of the database.
- Setup the RPi server
- Setup the RPi following setup step 2.
- Setup immich following setup step 3, Raspberry Pi up to and including step 7.
Important
Use the same
DB_PASSWORDused in step 4 above. - Restore the database following Recovery From Cloud Storage steps 7 to 9.
- Configure backups following setup step 4
- Setup remote access following setup step 5