chapoi
16 juni 2026 om 09:48
2
Hello and wow, welcome back after 9 years!
Pretty cool to see such a long running forum.
I think this is the same index problem as talked about here: Can't restore due to corrupt indexes (with some clues on how to deal with corrupt indexes)
It’s something like this:
The incoming_referers table tracks the URL paths that referred visitors to your forum. It has a unique index, meaning no two rows can have the same path + domain combination.
Your database has two rows with path='//' and incoming_domain_id=5. When it tries to rebuild this unique index during restore, it finds the duplicate and aborts the entire restore transaction.
So you’ll need to find and cleanup that duplicate incoming_referers and then make a new backup to restore on the new server.
I found this topic with instructions that might help you
Enter container
./launcher enter app
Connect to database
su postgres -c 'psql discourse'
Try to find duplicates
discourse=# select * from incoming_referers where path LIKE '%/search/' ORDER BY incoming_domain_id;`
id | path | incoming_domain_id
------+------------+--------------------
3339 | /search/ | 33
6257 | /search/ | 91
1567 | /search/ | 298
1777 | /search/ | 341
3010 | /search/ | 418
6247 | /search/ | 418
4293 | /search/ | 644
2899 | /search/ | 653
3447 | /search/ | 793
3696 | /search/ | 852
4395 | /a/search/ | 1050
6968 | /search/ | 1305
5634 | /search/ | 1387
5834 | /search/ | 1437
6519 | /search/ | 1637
7127 | /search/ | 1787
7280 | /search/ | 1827
(17 rows)
Delete duplicate
DELETE FROM incoming_referers WHERE path LIKE '%/search/' AND id IN (6247);
Then rebuild
discourse=# REINDEX SCHEMA CONCURRENTLY public;
WARNING: cannot reindex invalid index "public.incoming_referers_pkey_ccnew" concurrently, skipping
WARNING: cannot reindex invalid index "public.index_incoming_referers_on_path_and_incoming_domain_id_ccnew" concurrently, skipping
WARNING: cannot reindex invalid index "pg_toast.pg_toast_20732_index_ccnew" concurrently, skipping
REINDEX