Support » Networking WordPress » Text Widgets Deactivated on Cloning

  • plembo

    (@plembo)



    We have a number of WP multisite installations running on virtual RHEL 6 servers in our data center. Most of those installs are deployed as either dev (devblogs.example.com) or prod (blogs.example.com) instances for the same sites. From time to time I’m called upon to clone a prod instance over its dev counterpart (yes, that sounds backwards to me too, but I’m not a WP developer, just a humble sysadmin).

    Cloning is accomplished by taking prod off line after hours, doing a mysqldump of the db and then copying it along with the files (tarred up to preserver perms) over to the dev server. A search and replace is done on the sql dump file to substitute the dev hostname and subdomain for their prod counterparts. We do the same on the prod files. Then the dev db is overwritten with the modified sql and the modified prod files moved in to replace the old dev files.

    Everything comes back perfectly — except all the sidebar (php-laden) text widgets. Those are all relegated to the Inactive Widgets area in the Dashboard’s Appearance… Widgets tab.

    This wouldn’t be a real problem if it didn’t affect dozens of sites in each environment. Having to go through and manually repair things on all those sites is a tedious and demoralizing task.

    Anyone have any ideas about how to avoid or solve this problem beyond increasing the number of interns we employ (which right now, and for the foreseeable future, is exactly zero)? Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Alex Phelps

    (@alexphelps3)

    During your search and replace is it possible that the sidebar widget area is being renamed either as a registered widget area in the db or in the files themselves?

    I ask this because your widgets are being moved from the sidebar which is an active area that widgets can go in and then after your clone process that widget area cannot be found anymore so they go to inactive.

    I believe that something about your clone process is changing the name of the widget area so the options table doesn’t line up anymore.

    Sorry for the delayed response. I doubt my search and replace did this: I’m basically using a perl one-liner against the mysqldump output:

    perl -pi -e 's/oldsite.example.com/newsite.example.com/g' dump.sql

    My own idea after seeing this happen multiple times is that this might be due to the snapshots being done while the instance is “hot”, that is while still connected to the web server and receiving traffic. One of the things I’ll try the next time around is to shut down the web server to prevent any access to the instance during the time mysqldump is running.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Text Widgets Deactivated on Cloning’ is closed to new replies.