Reputation: 8877
I have recently moved a multisite network to a new domain. There is only 1 site in the network currently (I'm in the process of building the sites for the network and I am pushing this one to a staging server for testing).
To move the site I did the following:
wp-config.php
file on the staging server with the correct DB info and the updated URLAt this stage nearly everything works perfectly, everything except theme customisations. I realise this is stored as a serialized array, and I've updated the length of each of the fields accordingly. See below for 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 has been ******
'd.
Whenever I visit the customisation area of the theme I see the fields, but don't see any of the values. None of the stored values are shown on the frontend either, which leads me to believe it is a problem with this field in the database.
Any ideas?
Upvotes: 3
Views: 98
Reputation: 38238
Your problem seems to be with 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've counted the characters wrong. Certainly if I cut and paste your version—and replace the asterisks that you've put in numeric fields—I need to set the length to be 243, not 224, in order to properly deserialise. However, given that copying and pasting to and from Stack Overflow is probably confusing things, it's hard to be sure. There are almost certainly some issues in the whitespace that will make this hard to diagnose.
If it is a problem with the manual update of your serialisations, you should see errors, at least in the server error log, which will help you pinpoint the problem, e.g. "PHP Notice: unserialize(): Error at offset X of Y bytes in /path/to/file.php", which might give you some clues.
I recommend that instead of updating lengths manually, you use a script designed specifically for this purpose, that will deserialise the values in your database, do the replacement, and then reserialise them. I use Search-Replace-DB for exactly this purpose when pushing WordPress databases to my staging site.
Upvotes: 0