From c902c93082691d09c794fb893bd44f125cb64b72 Mon Sep 17 00:00:00 2001
From: Matthew Momjian <50788000+mmomjian@users.noreply.github.com>
Date: Thu, 11 Apr 2024 01:35:38 -0400
Subject: [PATCH] docs: fix earthdistance restore (#8692)

Update backup-and-restore.md
---
 docs/docs/administration/backup-and-restore.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/docs/docs/administration/backup-and-restore.md b/docs/docs/administration/backup-and-restore.md
index 1f5a13dac0..e949f8d998 100644
--- a/docs/docs/administration/backup-and-restore.md
+++ b/docs/docs/administration/backup-and-restore.md
@@ -86,6 +86,12 @@ Then you can restore with the same command but pointed at the latest dump.
 gunzip < db_dumps/last/immich-latest.sql.gz | docker exec -i immich_postgres psql --username=postgres
 ```
 
+:::note
+If you see the error `ERROR:  type "earth" does not exist`, or you have problems with Reverse Geocoding after a restore, add the following `sed` fragment to your restore command.
+
+Example: `gunzip < "/path/to/backup/dump.sql.gz" | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" | docker exec -i immich_postgres psql --username=postgres`
+:::
+
 ## Filesystem
 
 Immich stores two types of content in the filesystem: (1) original, unmodified content, and (2) generated content. Only the original content needs to be backed-up, which includes the following folders: