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

This widget could not be displayed.

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
UPDATE BODYCONTENT 
 SET BODY = REPLACE(BODY,'<old_string>','<new_string>');

This is the underlying issue I think you run into https://confluence.atlassian.com/confkb/some-attachments-or-links-are-no-longer-accessible-after-server-migration-214862724.html . 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

This widget could not be displayed.

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

Screenshot_2.png

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
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

555 views 7 6
Join discussion

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