Immich: Difference between revisions
added fixes for 25.05 upgrade issue |
m Fix typo |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 40: | Line 40: | ||
}; | }; | ||
}} | }} | ||
=== Using borg for backups === | |||
Following Immichs [https://immich.app/docs/administration/backup-and-restore/ backup docs] and [https://immich.app/docs/guides/template-backup-script backup script] an automated backup using [[Borg backup]] could look something like this: | |||
{{File|3=services.borgbackup.jobs."Immich" = { | |||
paths = "/var/lib/immich"; | |||
repo = "<path-to-borg-repo>"; | |||
startAt = "Sat 04:00"; | |||
compression = "zstd"; | |||
encryption.mode = "none"; | |||
prune.keep = { | |||
last = 2; | |||
}; | |||
};|name=/etc/nixos/configuration.nix|lang=nix}} | |||
Make sure to manually create a borg repo at the desired location beforehand with <code>sudo borg init --encryption=none <path-to-borg-repo</code> | |||
== Troubleshooting == | == Troubleshooting == | ||
| Line 55: | Line 70: | ||
Jul 01 14:23:12 server2 immich[178592]: line: '477', | Jul 01 14:23:12 server2 immich[178592]: line: '477', | ||
Jul 01 14:23:12 server2 immich[178592]: routine: 'CheckMyDatabase' | Jul 01 14:23:12 server2 immich[178592]: routine: 'CheckMyDatabase' | ||
Jul 01 14:23:12 server2 immich[178592]: }</syntaxhighlight>To fix this, run <code>sudo -u immich psql -d immich</code> and execute these | Jul 01 14:23:12 server2 immich[178592]: }</syntaxhighlight>To fix this, run <code>sudo -u immich psql -d immich</code> and execute these two commands:<syntaxhighlight lang="sql" line="1"> | ||
ALTER DATABASE immich REFRESH COLLATION VERSION; | ALTER DATABASE immich REFRESH COLLATION VERSION; | ||
REINDEX DATABASE immich; | REINDEX DATABASE immich; | ||
| Line 73: | Line 88: | ||
SELECT pgvectors_upgrade(); | SELECT pgvectors_upgrade(); | ||
</syntaxhighlight>Finally, restart postgresql and immich: <code>systemctl restart postgresql && systemctl restart immich-server</code> | </syntaxhighlight>Finally, restart postgresql and immich: <code>systemctl restart postgresql && systemctl restart immich-server</code> | ||
=== Immich server too old on NixOS stable === | |||
If you encounter errors like <code>Error processing stream</code> or <code>Error in runInIsolateGentle for remote-sync</code> on Android/iOS clients, the cause may be that the Immich server version packaged in <code>nixos-stable</code> is behind the mobile apps. | |||
You can use the Immich package from <code>nixos-unstable</code> while keeping the rest of your system on stable. Add the following to the top of your <code>/etc/nixos/configuration.nix</code>: | |||
<syntaxhighlight lang="nix" line> | |||
let | |||
unstableTarball = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"; | |||
in { | |||
nixpkgs.config = { | |||
packageOverrides = pkgs: { | |||
unstable = import unstableTarball { | |||
config = config.nixpkgs.config; | |||
}; | |||
}; | |||
}; | |||
} | |||
</syntaxhighlight> | |||
Then override the Immich package in your service config: | |||
<syntaxhighlight lang="nix" line> | |||
services.immich.package = pkgs.unstable.immich; | |||
</syntaxhighlight> | |||
[[Category:Server]] | [[Category:Server]] | ||
[[Category:Web Applications]] | [[Category:Web Applications]] | ||