Update: This is useful only if you can’t edit your local
/etc/hosts file (using a tool like Gas Mask makes it fast and super easy) and use the production domain for development.
To my knowledge, there was no way to work on a WordPress Multisite network locally while using a production database, so I spent a few hours and created a simple MU plugin which allows you to do just that.
The way Multisite Local Dev works is it filters all
get_site_option calls for
home values to correct the site URLs. In addition, we define both
$current_blog globals already in
wp-config.php to stop WordPress from querying database for these variables in
wp-includes/ms-settings.php, which is the key to this solution.
Currently this works only with sites in sub-folders, but it should be relatively easy to modify it for either subdomains or separate domains.