Home » Wordpress » WordPress: moving multisites gives Error establishing database connection

WordPress: moving multisites gives Error establishing database connection

Posted by: admin November 30, 2017 Leave a comment

Questions:

After moving my WordPress Multisites to new domain it gives error in database connection
following is my config.php file

define('WP_DEBUG', false);
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
$base = '/';
define('DOMAIN_CURRENT_SITE', 'www.vanijyabhawan.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);

I’ve replace all possible value database. but no hopes

Thanks

Answers:

Without knowing more about your setup (did you just dump your DB and push it into the new server’s database instance?), I’d say it likely is somewhere in your database. To check, you could grep your database dump:

cat your_db_file.sql | grep -i theolddomain.com

If you find indeed that there are references to your old domain, you can easily replace them like so:

find your_db_file.sql | xargs perl -pi -e "s/theolddomain.com/thenewdomain.com/g"

Multisite is VERY particular about it’s domain entries, make sure to go back over all of your settings such as domain mappings, primary domain check, etc.