Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Our team has run in to a problem working with WordPress 3 multisite. We usually work with a local copy of the site (localhost/testsite) but with the same database to keep all changes up to date.

This works fine in a single install because you can override the database configs from PHP with:

define( 'URL', $path );  
define( 'WP_HOME', $path );  
define( 'WP_SITEURL', $path );  
define( 'WP_CONTENT_URL', $path . '/wp-content' );  

But this doesn't work on the multisite because of the extra tables (wp_blogs, wp_site) and they have the path to the blog in their settings.

Does anyone know how to override these settings? I would like the site to run on domain localhost for our developers, developerdomain.com for our test servers and then realdomain.com when the site goes live.

It feels kind of like overkill if we have to set up different databases for each of them and change the domain and path manually and then copy the post, blog and user data between the databases to do debugging and continue the development...

share|improve this question

migrated from stackoverflow.com Oct 3 '11 at 11:47

This question came from our site for professional and enthusiast programmers.

    
I came up with a pretty simple solution that continues to maintain things in wp-config.php: stackoverflow.com/a/16327059/76672 No plugins, might not be for everyone... –  Jake May 1 '13 at 21:49

2 Answers 2

Just came up with a solution to this issue posted here http://stackoverflow.com/questions/12958123/override-wp-siteurl-and-wp-home-for-wordpress-multisite/

Basically you do not copy the wp_site and wp_blogs tables to your development installs when pulling in a production database, and have pre-configured them locally for your development URLs. You then leverage a network-wide plugin to set the WP_SITEURL and WP_HOME values based on configuration in wp-config.php.

Will likely turn this into a plugin once I have time to test it further.

Hope that helps!

share|improve this answer

This problem has been rectified in recent versions of WordPress. However, the easiest solution to this is to make the file paths on the servers match, e.g. put all source in /var/www/ on each server. Nice and easy :-)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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