0

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:

  • Transferred ALL files
  • Exported the full database from database A and imported into database B on staging
  • Ran a series of find & replace queries on all tables to replace the old domain with the new domain
  • Updated my wp-config.php file on the staging server with the correct DB info and the updated URL

At 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?

1

Here is the procedure to properly migrate a Wordpress Multisite.

Step 1 – Move Database and Files

The first step is to open your FTP client and upload the files from your computer to the server. Next, on your server set up your database and user, and use phpMyAdmin to import all the database tables.

If you visit your site now it won’t work, you’ve got some more work ahead of us before you’ll be greeted by a fully working multisite installation on our production server.

Step 2 – Modify wp-config.php and .htaccess

Now we need to modify wp-config.php and the .htaccess files to reflect the new location, database name, user and password. This should be quite straightforward. Be careful to replace any instance of the old URL with the new one.

Step 3 – Modify Database Tables

This is the step when most things can go wrong. You need to carefully modify the database to reflect the new location of your site.

Go to table wp_options

In this table, change the fields site_url and home.

Go to table wp_blogs

Replace the domain and path fields with the new values.

Go to table wp_site

Replace the domain and path fields with the new values.

Go to table wp_sitemeta

Change the site_url field

Searching and Replacing within each Subsite

At this point your site should be loading, however you still have potentially many references to the previous URL in each sub site’s tables. We need to change those through a search and replace procedure.

Hope this helps.

  • Thats the process i have followed, and the site loads and operates fine, except for the theme customisations. Its likely something wrong with the serialized array, but I cant see what – mikemike Dec 22 '14 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.