WordPress.org

Ready to get started?Download WordPress

Forums

Migrating without losing serialized data? (11 posts)

  1. Treebeard
    Member
    Posted 1 year ago #

    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!

    :)

  2. 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 How to Move WordPress to New Domain or Location » My Digital Life

  3. Treebeard
    Member
    Posted 1 year ago #

    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 :)

  4. 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.

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

    For this kind of thing I always use the wonderful serialized search & replace tool by interconnect/it:
    http://interconnectit.com/124/search-and-replace-for-wordpress-databases/

  6. Treebeard
    Member
    Posted 1 year ago #

    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: http://sewmyheadon.com/2009/mysql-search-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.

  7. Treebeard
    Member
    Posted 1 year ago #

    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?

  8. 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.

    It's a simple copy and paste for each table. Read the link http://www.mydigitallife.info/how-to-move-wordpress-blog-to-new-domain-or-location/ Search for tutorials on how to use phpmyadmin.

  9. Treebeard
    Member
    Posted 1 year ago #

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

  10. 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.
    http://stackoverflow.com/questions/639531/mysql-search-in-all-fields-from-every-table-from-a-database

  11. Treebeard
    Member
    Posted 1 year ago #

    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 12.123.122.123 and replace it with http://mywebsite.com 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!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.