Fixing confluence attachments URL

Hello. Recently i've moved confluence to another physical server. After that old attachements to pages no longer accessible because they are still have old server URL in link.

Can anybody suggest how-to fix it?

2 answers

1 accepted

1 vote
Answer accepted

Hi Vadim,

You should be able to bulk update this globally on the instance but keep in mind this method should be done with caution and I recommend a lot of select statements first to pinpoint the best approach to change URLs.

// Ex, https://oldBaseUrl and https://newBaseUrl
 SET BODY = REPLACE(BODY,'<old_string>','<new_string>');

This is the underlying issue I think you run into . I recommend installing Source Editor where you can copy a page and try the approach with search and replace in a controlled manner.

Thanks you very much. Thats exactly what i needed.

No problems good luck! smile

1 vote

How are the attachements "no longer accessible" - do you mean via page -> attachments?  Do they show up there, but give an error when clicked?  What is the error?

Can you check that

  • Your base url is correct in admin -> general config
  • Your directory is correct in the confluence home / confluence.cfg.xml

Thanks for the answer. Here is screenshot


If i click on that attachement it points to old URL, what used before migration.

image2017-3-10 14:29:19.png

And yes, base url is correct and attachments dir path correct also.

<property name="attachments.dir">${confluenceHome}/attachments</property>

Ah, ok, that looks like someone has embedded the link as a link, instead of using Confluence's internal links.  I think

Before I go any further down that path, I'd like to confirm it - could you edit the page, and look at the exact type of link there is there.  Is it a full web link, or an "embed attachment" macro?  (Don't need to save the page).  If you're not sure, then can you have a look in "view source" and see how the link is shown in there?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

264 views 2 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you