WOW! Discourse isn’t importing it’s backups cleanly, their recommended solution is to manually delete entries and their links from postgres (or to pay someone) Going to delete everything and try rebuilding it again
Argh! Trying to rebuild it once again, and turns out the DNS changes didn’t propogate fully yet, and now hit the letsencrypt rate limit
Fresh rebuilds didn’t work. I’ve reverted DNS back to old instance and after diving deep into whats wrong I found some issues in the data:
ERROR: could not create unique index "index_incoming_referers_on_path_and_incoming_domain_id"
DETAIL: Key (path, incoming_domain_id)=(/r/clojure.compact, 1229) is duplicated.
EXCEPTION: psql failed: DETAIL: Key (path, incoming_domain_id)=(/r/clojure.compact, 1229) is duplicated.
Then I connected to our old instance pg container and tried to debug this
discourse=# select path, count(path) as cp from incoming_referers group by path, incoming_domain_id having COUNT(*) > 1;
path | cp
---------------------+----
/t:clojure | 2
/r/clojure.compact | 2
/r/clojure/.compact | 2
/r/clojure.compact | 2
(4 rows)
Looks like there are duplicates where these shouldn’t exist
okay I manually removed all conflicts from the postgres referrer table, these tables are related to link tables so I made sure to not break them:
discourse=# select * from incoming_referers where path LIKE '%/r/clojure/.compact%';
id | path | incoming_domain_id
------+---------------------+--------------------
1259 | /r/clojure/.compact | 829
8154 | /r/clojure/.compact | 829
(2 rows)
discourse=# update incoming_referers set path = '/r/clojure.compact/' where id=8154;
UPDATE 1
discourse=# select path, count(path) as cp from incoming_referers group by path, incoming_domain_id having COUNT(*) > 1;
creating a new backup and trying to restore that now
YES!! This worked Going to try and work through the LetsEncrypt rate limit by manually syncing the certs from the previous instance
Something wrong with SMTP configuration, looking into it!
We’re done with the complete successful migration sharkdance clojure-spin! Emails are also working now but there are some background jobs running for the import process to complete. Due to this email notifications are disabled until all these tasks are completed. Will re-enable them soon!
Processing of all background tasks are completed, I’ve enabled email notifications/digest!
We’re done with the complete successful migration sharkdance clojure-spin! Emails are also working now but there are some background jobs running for the import process to complete. Due to this email notifications are disabled until all these tasks are completed. Will re-enable them soon!