Forums

Lost widgets after site URL change. (14 posts)

  1. fcb66
    Member
    Posted 1 year ago #

    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

  2. johnflufin
    Member
    Posted 1 year ago #

    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.

  3. deanoakley
    Member
    Posted 1 year ago #

    Same problem - Really annoying!

  4. mahalie
    Member
    Posted 1 year ago #

    bump!

  5. deanoakley
    Member
    Posted 1 year ago #

  6. mahalie
    Member
    Posted 1 year ago #

    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!

  7. fcb66
    Member
    Posted 1 year ago #

    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?!

  8. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    There must be a better way than this though?!

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

  9. fcb66
    Member
    Posted 1 year ago #

    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.

  10. mahalie
    Member
    Posted 1 year ago #

    @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!!

  11. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    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.

  12. deanoakley
    Member
    Posted 1 year ago #

    Ah yes thanks for the link cubecolour!

  13. xzoom
    Member
    Posted 9 months ago #

    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!

  14. esmi
    Theme Diva & Forum Moderator
    Posted 9 months ago #

    Please post a new topic.

Topic Closed

This topic has been closed to new replies.

About this Topic