Moving WordPress Multisite but my theme settings stopped working. What for?

I recently migrated my tiered network to a new domain. Currently there is only 1 site on the web (I am in the business of building sites for the web and I am pushing that on a staging server for testing).

To move the site, I did the following:

  • Transfer all files
  • Exported complete database from database A and imported to database B when organized
  • Design a series of search and replace queries across all tables to replace the old domain with the new domain
  • Updated my file wp-config.php

    on staging server with correct db info and updated url

At this point almost everything works fine, everything except the theme setting. I understand that this is stored as a serialized array and I have updated the length of each of the fields accordingly. See below the stored value:

a:19:{i:0;b:0;s:8:"tcx_logo";s:72:"http://stange.********.com/wp-content/uploads/2014/11/***-***-bottle.png";s:13:"tcx_address_1";s:12:"***** Avenue";s:13:"tcx_address_2";s:0:"";s:12:"tcx_citytown";s:7:"*******";s:10:"tcx_county";s:6:"******";s:12:"tcx_postcode";s:8:"**** ***";s:11:"tcx_country";s:0:"";s:7:"tcx_lat";d:**.**********0000076470314525067806243896484375;s:7:"tcx_lng";d:-*.**********00000065853100750246085226535797119140625;s:12:"tcx_facebook";s:12:"************";s:11:"tcx_twitter";s:12:"************";s:18:"nav_menu_locations";a:2:{s:9:"main-menu";i:2;s:6:"footer";i:3;}s:16:"tcx_openingtimes";s:0:"";s:13:"tcx_foodtimes";s:225:"<dl class="dl-horizontal">
    <dt>Monday to Thursday:</dt>
    <dd>12noon - 2:30pm & 5:30pm - 9:00pm</dd>

    <dt>Friday & Saturday:</dt>
    <dd>12noon - 2:30pm & 5:30pm - 9:00pm</dd>

    <dt>Sunday:</dt>
    <dd>12noon - 8:00pm</dd>
</dl>";s:13:"tcx_telephone";s:13:"**** *** 5535";s:9:"tcx_email";s:27:"info@****************.co.uk";s:14:"tcx_bookatable";s:17:"Bookatable Widget";s:10:"tcx_seekom";s:13:"Seekom Widget";}

      

Sensitive information was ******

' d.

When I visit the theme customization area, I see the fields, but I don't see any values. None of the stored values ​​show up on the interface either, which makes me think it is a problem with this field in the database.

Any ideas?

+3


source to share


1 answer


Your problem is related to this section:

s:225:"<dl class="dl-horizontal">
    <dt>Monday to Thursday:</dt>
    <dd>12noon - 2:30pm & 5:30pm - 9:00pm</dd>

    <dt>Friday & Saturday:</dt>
    <dd>12noon - 2:30pm & 5:30pm - 9:00pm</dd>

    <dt>Sunday:</dt>
    <dd>12noon - 8:00pm</dd>
</dl>"

      

... where I think you thought the symbols were wrong. Of course, if I cut and pasted your version - and replaced the asterisks you put in the numeric fields, I need to set the length to 243, not 224, in order to deserialize correctly. However, given that copy and paste in and out of Stack Overflow is likely to confuse things, it's hard to be sure. There are almost certainly some issues in the gap that make it difficult to diagnose.



If it is a problem with manually updating serializations, you should see errors, at least in the server error log, which will help you identify the problem, for example. "PHP side note: unserialize (): error on offset X bytes Y in /path/to/file.php" which may give you some hints.

I recommend that instead of manually updating the length, you use a script created specifically for this purpose, which will deserialize the values ​​in your database, perform the replacements, and then re-execute them. I am using Search-Replace-DB for exactly this purpose when clicking on WordPress databases on my staging site.

0


source







All Articles