Elgg migration to a new domain name - issues with embedded images

Hi and thanks for taking the time to read this.

We have an Elgg 2.3 site we use to share information. The membership of the site is small but the quantity of information is rather large. Recently it was necessary to move the site to a new domain name. I followed the instructions for duplicating elgg and moved the site and updated the database entries and config.

Everything worked fine except for and it's a big except; all embedded images of which there are several thousand on the site do not display. HTML src tag for each still points to the old url.

I'm pretty sure I haven't missed any step, I've been back over it multiple times and I've cleared the system_cache folder, cleared the cache via the admin page and upgraded php. I've tried deactivating and reactivating the embed plugin but to no effect.

I have the embed, embed extended and hypeEmbed plugins installed.

Is this a caching issue? Or do I have to go back and edit each link (6K+) or is there a script available to do this for me?

Any help would be greatly appreciated I'm getting a bit desperate.



  • Do you still have to the old domain? Can you setup a redirect? I think that would be the easiest.
    I did have a migration script somewhere for situations like this, I will dig to see if I can find it

  • Ok, found it. 

    Add this to your start.php, update the list of URLs, and run Upgrade from admin panel, then remove it. Alternatively, run this with run_function_once().


    Goes without saying, backup your database beforehand, in case something goes wrong.

  • Hi Ismayil

    Thanks so much for getting back to me, for security reasons a redirect is not an option unfortunately so I'm about to try your script.

    Just a query though you said to add it to the "start.php". Our ELGG installation as far as I can see doesn't have a start.php - did you mean index.php by any chance?

    Thanks again!

    EDIT ok I see every plugin and theme has a start.php. Should I add this code to start.php of the active theme or into one on the plugins? if so which one please, I have three installed in connection with embeds, one of which I think is yours (see orig msg)