Support » Fixing WordPress » Migrating without losing serialized data?

  • Does anyone know how to migrate a site to a new URL with a different length, without losing the serialized data? I have to develop sites on a test server first, so URLs are always going to be different lengths. I found some info on why we are losing data but I don’t know a way around it.

    Text Widgets and the Image Widget Plugin are usually the culprits, while everything else is fine (all our other widgets and plugins migrate without issues).

    Does anyone know any tricks to moving a huge site without losing serialized data?

    thanks in advance, we’re planning a huge migration tomorrow so any information you can share would be super awesome!


Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Mark Ratledge


    Forum Moderator

    Export the database with phpmyadmin and use queries to change URLs rather than search/replace in a text dump. See Moving WordPress ยซ WordPress Codex and

    UPDATE 6/16/2015:

    This tool is the way to change URLs in the database; it won’t break serailized data, like the queries above:

    Thanks, but I need to change about 100 tables / 1652 instances total so targeting one table at a time is not going to work, unfortunately. I tried a search/replace tool in a test site this morning, but I still lost all the Text Widgets.

    Any other ideas ๐Ÿ™‚

    Moderator Mark Ratledge


    Forum Moderator

    That’s the only way to do it. Use find/replace in a text editor with those queries to build a list of queries to run that includes all tables.

    Moderator cubecolour



    For this kind of thing I always use the wonderful serialized search & replace tool by interconnect/it:

    I know about that one, looks good, but I was trying to avoid having to select over 100 tables, that’s why I was using this search and replace tool: That does the trick with almost everything, except the text widgets. If I use that interconnectit tool, I might as well just go into phpMyAdmin and select the tables thre (same thing really).

    Looks like I’m going to have a major issue though:( So far, there seems to be no real solution to retain all text widgets after a migration. (Bummer!) You would think that WP developers would have thought of that one LOL! That’s really a major issue too, it’s all over the internet.

    RE: That’s the only way to do it. Use find/replace in a text editor with those queries to build a list of queries to run that includes all tables.

    I wish I knew what you were talking about, I don’t know much about phpMyAdmin / MySQL queries, only enough to use a text editor and find/replace, but queries is another language. I’m not a php programmer, unfortunately. And I’m sure it’s too much to ask about in a forum, I’d probably need some sort of full on lesson in mysql right? Unless it’s just a simple one liner that I can copy/paste for each table?

    Moderator Mark Ratledge


    Forum Moderator

    You would think that WP developers would have thought of that one LOL!

    They have; use queries in phpmyadmin and not search/replace in a text dump. MySQL queries are much more efficient.


    Right, but that’s only for the wp_options table. What about the other 100 tables LOL! In a multisite network, it’s unfathomable to think someone would actually sit here and copy/paste a query 1652 times in a row. In our case, over 100 network sites ALL with different table names, so it’s not “wp_options” it’s wp_100_options, wp_102_options, and so on, plus the postmeta, posts, and a few other tables for other plugins, like the broken link checker, etc. so 1652 times copy/paste.

    I know how to move a regular site, I was hoping for a workaround only because this multisite is ginormous, and the traditional way of moving a site as I’ve been doing for the past 10 years is not going to work this time.

    ugh. but thanks for the help, at least people on wp forums respond. I do appreciate it ๐Ÿ™‚

    <tomorrow is going to be a loooong day… I should charge extra for the carpal tunnel LOL!>

    Moderator Mark Ratledge


    Forum Moderator

    A) Use a hosts file to be able to develop on the dev server under another domain, i.e. the one you will be moving to.

    B) Use the queries in the examples, open a new text document, and duplicate them and find/replace for the different tables and table prefixes you need and run them a few hundred of them at a time.

    C) Learn phpmyadmin to select all tables in the whole database and find/replace, i.e.

    A) I would, but I’m not allowed to mess with the server I’m working on (I often do most of my WP work for another design firm; plus I have no idea what that would do to other sites on the test server, I’ve never done that before and wouldn’t know where to begin).

    B) I usually do this, but it doesn’t retain the serialized data, so Text widgets are completely gone

    C) Same issue as mentioned above. To quote from that post:

    “Choose the tables to search” – again, that’s what I was trying to resolve ๐Ÿ™‚

    1652 queries. Over 100 tables.. waaayy time consuming, just seems so inefficient. Someone with knowledge of MySQL probably has an answer that’s simple, but I have no idea where to begin. I’ve searched all over the internet, there’s really no info out there (least not in a language I could understand). I’m just looking for a simple query that would be like:

    find and replace it with but NOT having to search and select all the tables where that IP address is, just search the entire database and change it.

    That tool I mentioned above does that very well, except the text widgets are gone, so that’s the only problem.

    Thanks anyway though. I’ll keep researching, otherwise the client is going to have a helluva time adding all her content back for all those text widgets in all 107 websites in her network tomorrow. yuk!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Migrating without losing serialized data?’ is closed to new replies.