I like the idea of making developers connect their copies to the same database and just set WP_HOME and WP_SITEURL to configure the domain name as they like it. In this model, we don't need to keep migrating databases between servers, and the content will be kept in sync between developers. We also use this for staging, as each version has its own wp-config.php file.

If we try to make the same with multisite installs it won't work because it relies much more in the database values for domain names. So, what would be the best way of making multiple multisite development copies with different domains connect to the same database for development purposes like the non-multisite sites we're already dealing with?

  • Its not clear what you're asking, if taken literally it makes little sense, multisite installs can be put in the same database, just use different table prefixes for each install – Tom J Nowell Sep 28 '12 at 15:05
  • @TomJNowell, I'm asking something like: If I copy all the files of a multisite install to another server with a different domain, how can share the database with the original one, keeping all the content, blogs and configuration? – vmassuchetto Sep 28 '12 at 15:14
  • You mean copy the database? I don't understand why you would do such a thing as it would all end up going back to the first server anyway, sure you can change the menu, but all the internal links would point to one site – Tom J Nowell Sep 28 '12 at 16:06
  • It sounds like you're asking for a fix to a kludge that's supposed to be a fix, and what your real issue is, is that you need 2 sites but dont want to enter the content twice – Tom J Nowell Sep 28 '12 at 16:06
  • @TomJNowell, I refactored the whole question... Hope it's not more confusing now... =D – vmassuchetto Sep 28 '12 at 16:46

Instead of changing WP_HOME etc, it would be best to enforce a single domain, e.g. local.example.com or shared.example.com and then use the HOSTS file to set that address to

This way there is no change to the URLs at all as it is unnecessary, and the shared DB content is consistent (this menu doesn't work on Alice' machine because Bob created it on his machine, and he uses a different domain name to Alice )

Also keep in mind your situation has the fatal flaw of sharing post content, but not post attachment files/uploads.

  • Thanks for the answer! We're ok with uploaded files by remotely mounting directories. – vmassuchetto Sep 28 '12 at 17:43

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.