We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Changed domain name - attachments gone missing

Hi everyone,

A customer had a server crash and we moved the installation, they also changed the domain name for the site.

So, as usual, i changed the binding for the site, changed the url in crm7.config, the ejcron and in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SuperOffice Customer Service

So Customer Service is working just fine. 

However, for some reason all the attachments is missing (and yes, ive moved the attachment folder)

If i choose properties on a broken-link picture, it still shows the old URL.

Where is this stored?

I have solved this previous by running ejtermsetup or upgrade, but then had to deal with duplicates in Category and so forth, so what is the proper way to to this?

 

Regards
Pär Pettersson 

RE: Changed domain name - attachments gone missing

I would guess that attachments which are stored on a request  (for example a word document) works?

But it is inline images that are referenced in the text that has a broken URL?

That is because the URL to the images are stored as absolute paths in the messages. So if you change domain and want old images to work, you have to actually update this in the databse.
I think that Frode Lillerud has made a SQL script that fixes this?

 

By: Stian Andre Olsen 6 Feb 2014

RE: Changed domain name - attachments gone missing

Yes, you are correct, its only the pictures.

 

Frode, could you please help me out with this SQL script?

Thanks alot Stian!


Regards
Pär 

By: Pär Pettersson 6 Feb 2014

RE: Changed domain name - attachments gone missing

Here - take backup first!

-- Fix changed URL for inline images in Ejournal/Customer Service
UPDATE crm7.ej_message set html_body = cast(replace(cast(html_body as nvarchar(max)), 'old.server.com/scripts/', 'new.server.com/scripts/') as ntext)
WHERE html_body like '%old.server.com/scripts/%'

UPDATE crm7.kb_entry set question = cast(replace(cast(question as nvarchar(max)), 'old.server.com/scripts/', 'new.server.com/scripts/') as ntext)
WHERE question like '%old.server.com/scripts/%'

UPDATE crm7.kb_entry set answer = cast(replace(cast(answer as nvarchar(max)), 'old.server.com/scripts/', 'new.server.com/scripts/') as ntext)
WHERE answer like '%old.server.com/scripts/%'
 
By: Frode Lillerud 6 Feb 2014

RE: Changed domain name - attachments gone missing

We so need to fix this :-/

Sverre

By: Sverre Hjelm 6 Feb 2014

RE: Changed domain name - attachments gone missing

Worked like a charm.

Thanks alot!


Regards
Pär Pettersson 

By: Pär Pettersson 12 Feb 2014

RE: Changed domain name - attachments gone missing

Is this really still the solution 4 years later changing a lot of customer domains to new more unified domain names ? :P

Cheers

Søren

By: Søren Lund 18 Jan 2018

RE: Changed domain name - attachments gone missing

Unfortunately, yes, this is still the solution. We have not gotten around to create a system where the URL gets hot-parsed into the message text. Sorry :-/

Sverre

By: Sverre Hjelm 19 Jan 2018