• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Projects Immich

Immich Application Migration to a New Ubuntu Server (SNAP Installation)

neo by neo
May 27, 2025
in Immich
0
Immich Application Migration to a New Ubuntu Server (SNAP Installation)

Immich Application Migration to a New Ubuntu Server (SNAP Installation)

0
SHARES
399
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Migrating Immich Application (SNAP) to a New Server

Immich migration to the new server is a process that requires careful planning and execution to ensure that both the application’s database and media files are transferred successfully. Immich is a self-hosted photo and video storage solution that helps users manage their media efficiently. If you’re running Immich as a SNAP package and need to migrate it to a new server, it’s essential to back up your data, install the application on the new server, and restore your files and database correctly to avoid any data loss.

Immich is a powerful open-source solution for self-hosted photo and video storage, providing users with efficient media organization and sharing features.

This guide will walk you through the step-by-step process of migrating an Immich installation to a new server. We will cover how to back up the database and media files, install Immich on the new system, and restore everything to get Immich running smoothly.

Step-by-Step Guide to Migrating Immich to a New Server

Before starting the migration of the Immich application to a new server, ensure the following prerequisites are met:

  • Backup: Make sure to create a complete backup of both the database and media files using Immich’s built-in backup commands. This is crucial, as it ensures you have a restore point in case anything goes wrong during the migration process.
  • Server Requirements: The new server must meet the necessary hardware and software requirements for running Immich, including adequate storage and network configuration.
  • SNAP Package: Ensure that the SNAP package manager is installed on the new server so you can install Immich without any issues.

Step 1: Create a Immich Backup on the Old Immich Ubuntu Server

Before migrating, it’s crucial to back up both the database and files to prevent any data loss.

You have the following options using immich-distribution.backup command:

root@ubuntucore:/var/snap/immich-distribution/common/backups# immich-distribution.backup
/snap/immich-distribution/174/bin/backup [-d] [-a]

-d      Backup database
-a      Backup assets (images, videos, ...)
-l      List backups

The recommended way to backup Immich is to do a database backup, and then manually backup the assets directly from /var/snap/immich-distribution/common/upload

Create a Database Backup

Run the following command to back up the Immich database:

immich-distribution.backup -d

Location of the backup files:

/var/snap/immich-distribution/common/backups

Create a Media Files Backup

To create asset backup from Immich server you have to options:

ADVERTISEMENT
  • Use immich-distribution.backup option: it was very slow for me
  • Manually copy the files to the new server
Option 1: Immich Asset Backup

Back up the Immich assets (photos and videos) using:

immich-distribution.backup -a

Files are located on the following location:

/var/snap/immich-distribution/common/backups

IMPORTANT: In my case, this operation is very slow. The process is using just one CPU!!!

To ensure the backup continues running even if the session is lost, I executed it using nohup:

 nohup immich-distribution.backup -a > /home/user/backup-asset-try2.log  &
CPU Usage during backup, htop output
CPU Usage during backup, htop output
Option 2: Manual Files Backup -> In my Case Faster Way

Step 1: Navigate to the /var/snap/immich-distribution/common/upload/

Content of the folder:

backups  
encoded-video  
library  
profile  
thumbs  
upload

Step 2: Copy files to the new server

scp -r /var/snap/immich-distribution/common/upload/{*,.*} user@[IP_ADDRESS_OF_NEW_SERVER]:/home/user/

You can just copy evrything from the /var/snap/immich-distribution/common/upload/ location to the new server. It is faster operation.

In this case you can just restore Database on the new server and move this data to the same location on the new server.

Step 2: Copy Backed-up Files to the New Ubuntu Server

Once the backup is complete, transfer the backup files to the new server using SCP:

scp * new_server_user@[IP_ADDRESS_OF_NEW_SERVER]:/home/user

Replace new_server_user and [IP_ADDRESS_OF_NEW_SERVER] with your actual server username and IP address.

Step 3: Install Immich on the New Server

Before restoring the backups, install the Immich application on the new server using the SNAP package manager:

ADVERTISEMENT
snap install immich-distribution

Check Immich Version and update old server if needed:

 snap list

Outpu of the command is something like:

Name                 Version        Rev    Tracking       Publisher   Notes
immich-distribution  v1.124.2       174    latest/stable  nsg         -

Step 4: Move Backup Files to the Correct Directory

On the new server, navigate to the user’s home directory and copy the backup files to the Immich backup location:

ADVERTISEMENT

Adapt permissions for the copied files:

cd /home/user
sudo chown -R root:root immich_assets_v1.124.2_2025-01-31T090234.tar.xz

Then, copy the backup files to the Immich backup directory:

cp immich_* /var/snap/immich-distribution/common/backups/

Step 5: Stop the Immich Application

Before restoring the backups, stop the Immich service to prevent any conflicts:

snap stop immich-distribution

Step 6: Restore the Database

Run the following command to restore the database backup:

cd /var/snap/immich-distribution/common/backups/
immich-distribution.restore -y -d immich_database_v1.124.2_2025-01-31T114826.sql.xz

Make sure to replace the filename with the actual database backup file you created earlier.

Step 7: Restore Media Files

Option 1: Immich Asset Backup/Restore

1In case you are working with asset backup:

Now, restore the backed-up media files:

cd /var/snap/immich-distribution/common/backups/
immich-distribution.restore -y -a immich_assets_v1.124.2_2025-01-31T114919.tar.xz

Again, replace the filename with the correct one from your backup.

Option 2: Manual Files Backup/Restore

In case that you copy all files from the old server location /var/snap/immich-distribution/common to the new servr, just move these files the the same location on the new server.

cd /home/user/upload
cp -r * /var/snap/immich-distribution/common/upload/

Change permissions:

sudo chown -R root:root /var/snap/immich-distribution/common/upload
sudo chmod -R 755 /var/snap/immich-distribution/common/upload

Step 8: Start the Immich Application on the New Server

snap start immich-distribution

This will initialize Immich with the restored database and media files.

Step 9: Open Immich Application in Browser

If the images are not displaying, generate new thumbnails. In this case, they were not copied from the original server.

Immich Generate Thumbnails
Immich Generate Thumbnails

Conclusion

Migrating Immich to a new server is a straightforward process if done corrReectly. By following these steps, you can ensure a seamless transition without losing any photos or database information. Regular backups are essential for maintaining data integrity, so make sure to perform them frequently to prevent data loss in case of unexpected failures.

If you found this guide helpful, consider sharing it with others in the self-hosted community!

About The Author

neo

See author's posts

ADVERTISEMENT
Previous Post

Fortinet FortiGate Firmware Upgrade

Next Post

Immich: Resource Usage & Monitoring for 4 Users

neo

neo

Related Posts

Configure Linux Server and Immich SNAP Application Monitoring with Monit
Immich

Configure Linux Server and Immich SNAP Application Monitoring with Monit

Organizing and Managing Photos with Immich: Features I Use
Immich

Organizing and Managing Photos with Immich: Features I Use

Immich: Resource Usage & Monitoring for 4 Users
Immich

Immich: Resource Usage & Monitoring for 4 Users

Immich Example
Immich

Immich: Generate Let’s Encrypt Certificate on Ubuntu 22.04 Server

Immich: Installation on Ubuntu 22.04
Immich

Immich: Installation on Ubuntu 22.04

Next Post
Immich: Resource Usage & Monitoring for 4 Users

Immich: Resource Usage & Monitoring for 4 Users

Recommended

Oracle VirtualBox: Port Forwarding in NAT Network Mode

Oracle VirtualBox: Port Forwarding in NAT Network Mode

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

My Way to Organize a Git Repository for Bash, Mikrotik, FortiGate and other Scripts

My Way to Organize a Git Repository for Bash, Mikrotik, FortiGate and other Scripts

My Ultimate Linux/Ubuntu Commands Cheat Sheet (2025)

My Ultimate Linux/Ubuntu Commands Cheat Sheet (2025)

My Ultimate Docker Command Cheat Sheet (2025 Edition)

My Ultimate Docker Commands Cheat Sheet (2025 Edition)

Categories

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos
ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Recent News

My Way to Organize a Git Repository for Bash, Mikrotik, FortiGate and other Scripts

My Way to Organize a Git Repository for Bash, Mikrotik, FortiGate and other Scripts

My Ultimate Linux/Ubuntu Commands Cheat Sheet (2025)

My Ultimate Linux/Ubuntu Commands Cheat Sheet (2025)

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.