Rewriting all occurences of forums.coretabs.net to discourse.coretabs.net
THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES)
YES
Error: ERROR: duplicate key value violates unique constraint "index_incoming_domains_on_name_and_https_and_port"
DETAIL: Key (name, https, port)=(discourse.coretabs.net, t, 443) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.
rails c
DB.exec "UPDATE incoming_domains SET name='discourse-old.coretabs.net' WHERE name = 'discourse.coretabs.net'"
Das ist wahrscheinlich das, was du brauchst. Es wird zwar zu einer geringfügigen Dateninkonsistenz führen, aber zumindest sollte die Neuzuordnung wahrscheinlich funktionieren.
Ich habe den von dir genannten Befehl ausgeführt (ohne from)
Ich habe das Rebacken erneut gestartet, und diesmal blieb es hier stehen:
Rewriting all occurences of forums.coretabs.net to discourse.coretabs.net
THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES)
YES
incoming_domains=1
incoming_referers=3
invites=1
javascript_caches=1
post_revisions=509
posts=84
single_sign_on_records=1099
theme_fields=4
topic_custom_fields=4
Error: ERROR: duplicate key value violates unique constraint "unique_post_links"
DETAIL: Key (topic_id, post_id, url)=(69, 212, https://discourse.coretabs.net/t/topic/365) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.
Ich habe nach "unique_post_links" gesucht und herausgefunden, dass die dazugehörige Tabelle topic_links heißt, wie im schema.sql zu sehen.
Da die Links dieses Mal nur teilweise vorhanden waren, habe ich eine REPLACE-Abfrage verwendet:
DB.exec "update topic_links set url=REPLACE(url, 'discourse.coretabs.net', 'discourse-old.coretabs.net')"