A user is experiencing broken uploaded images after restoring a Discourse backup to a new server. The images are linked to the old forum’s domain instead of the new one. The issue is resolved by using the discourse remap command to update the domain URLs. The user provides the exact steps, including entering the container, installing Thor, and running the remap command, followed by rebaking posts. Another user reports a similar issue with a warning about type casting, questioning if the command has changed or if it affects prose content.
I have 2 instances of the same forum: an old one hosted in DigitalOcean, and a new one hosted on our company server and accessible only on our company intranet. I am original admin of the old forum only.
The backup of 1st forum has been restored to the new one, everything worked fine except user uploaded images in posts. They are all broken.
As you can see in this snapshot where I edit a post with a broken image, the image does appear in the preview and the url seems to be relative, so I assume it points to the picture hosted on the new intranet server.
But the link on the rendered post is absolute and refers to the old forum (inaccessible from our intranet): https://www.oldforum.com/uploads/default/original/1X/be73346d397d355ee1e03e817a2beecfac28bad3.png
It should point to https://www.newforum.com/uploads/...
What can I do to solve this issue?
PS: I’m far from a specialist, I somehow managed to set up my first discourse instance following the great step-by-step guides available out there…
I’ll ask for my fellow admin to check this, sure worth it!
I’ve found out that I can simply force an absolute path for the image by editing the url to the newer domain. But doing this for each uploaded picture is quite a challenge ^^
Перезапись всех вхождений discourse.old_domain.org на discourse.new_domain.org
ЭТА ОПЕРАЦИЯ ПЕРЕПИШЕТ ДАННЫЕ, ВЫ УВЕРЕНЫ (введите YES)
YES
Предупреждение: для типа "name" с oid 19 не определен приведение типа. Пожалуйста, явно приведите этот тип к TEXT, чтобы быть в безопасности при будущих изменениях.
Готово
Возможно, команда была обновлена и теперь требует какой-то флаг или переменную? Также перезапишет ли это вхождения старого домена в тексте? Я просто пытаюсь исправить изображения.