[SOLVED] Changed domain how to update media urls?

My version of HedgeDoc is: 1.9.9

I’m running hedgedoc in a docker container on Unraid. Everything works perfectly. I want to change the domain so it’s at newurl dot com instead of oldurl dot com. If I try to use newurl dot com everything works exactly as expected except none of the images I’ve added inside notes will load. I assume I need to update the database so it uses the new URL, but I’m not sure how. I’m using a postgres database.

Thanks for any help!

I figured it out. It was really easy. The urls are just directly embedded in the notes so a find & replace command will fix it.

UPDATE "Notes" SET content = REPLACE(content, 'https://oldurl dot com', 'https://newurl dot com') WHERE content LIKE '%https://oldurl dot com%';

Hi @jroneilky and welcome to the HedgeDoc community!

Great to see, you already figured it out. The note content is stored as-is, so you’re right that old links need to be updated manually in the database. This also applies when changing the upload storage backend - in this case there’s a minimal script bin/migrate_fs_to_minio that can be modified to be fitting to your situation.

1 Like

Hello,
Thanks for the solution this is very helpful for me.