• Hi,

    I’ve recently put together a site that was hidden under a sub domain for develpment. Now it’s finished it’s been moved to the proper URL. During this move I ran a the following SQL scripts to change the URL stings in the DB.

    UPDATE wp_options SET option_value = REPLACE(.....);
    UPDATE wp_postmeta SET meta_value = REPLACE(....);
    UPDATE wp_posts SET guid = REPLACE(....);
    UPDATE wp_posts SET post_content = REPLACE(....)

    Everything is fine, (so far!), apart from the widgets which have all vanished.

    What do I need to do to bring them back?
    (I can recreate them obviously, but this will be a fairly standard development process for us so it would be nice to have a quicker way of fixing the issue.)

    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • Same problem here. In my case, it was easier to just re-setup my widgets than to attempt a recover but I can see how this could be a big a headache for some users.

    Same problem – Really annoying!

    bump!

    Thanks for the link, yes, looks like maybe if you edit the serialized key in case of length change? Anyone done this successfully? For now I recreated mine, too much time spent on this and I have a deadline!

    Thread Starter fcb66

    (@fcb66)

    Not yet! :o(

    Just went through the process of a domain change yesterday and the text widgets went missing again.

    I’d descovered the issue with the string length needing to be changed with serialised keys after going through a DB export line by line to see if there was something the search and replace was missing.

    Currently it seems to be only the text widget that causes a problem. So my current process is to copy the content out of any text widgets into a text file. Export the DB then manually search and replace the domain name adjusting any string lengths as required. Import the modified file and then recreate the text widgets. All of which can take a long time if there is a lot of data. Fortunately I’ve only had to do this with new sites so there is very little data in them. I wouldn’t want to do it with an established site!

    There must be a better way than this though?!

    Moderator cubecolour

    (@numeeja)

    There must be a better way than this though?!

    Have a look at: https://spectacu.la/search-and-replace-for-wordpress-databases/

    Thread Starter fcb66

    (@fcb66)

    That looks like it will do the job.

    Not sure when we’re due to do another domain move, but I’ll definitely try this out when we do.

    Thanks for the link.

    @cubecolour that looks like the hotness – fix for serialized issues. Agree with article author, the db should be structured data and fairly platform agnostic (ideally). The widgets architecture is SLOPPY.

    I’m saving this article for next time I have to migrate a site. Cheers!!

    Moderator cubecolour

    (@numeeja)

    I cannot take any credit – I only provided a link. This solved the problem when I had this same issue.

    If it has helped you, don’t forget to thank Dave & the team at interconnect IT for their work in creating this fantastic script & sharing it with the community.

    Ah yes thanks for the link cubecolour!

    Hi!

    I have this problem also…. but I don’t understand why it doesn’t happen when I work with local copy on MAC and WAMPP.

    Thanks!

    Please post a new topic.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Lost widgets after site URL change.’ is closed to new replies.