Our client has existing websites build with WordPress multisite, I am trying to grab a copy setup on my local environment.
So I grab the database from prod. now I successfully imported it on my local.
Lastly, I edit the URL in the multisite configuration
define( 'WP_ALLOW_MULTISITE', true ); define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); define('DOMAIN_CURRENT_SITE', 'mylocal-copy.test'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1);
Anyhow everytime I visit mylocal-copy.test it returns.
Error establishing a database connection
I'm pretty sure that database is all set and up and running.
Now I go to database and found wp_blog table I edit the first-row domain column to my local env domain and it works, however those other websites when I click to visit the site on the dashboard it redirects on the prod or lives server.
My question is do I need to edit all row of wp_blog table in order to run this multisite in my local? or maybe I missed something on wp-config.php?
My wp-config.php
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_working');
/** MySQL database username */
define('DB_USER', 'secret');
/** MySQL database password */
define('DB_PASSWORD', 'secret');
/** MySQL hostname */
define('DB_HOST', 'localhost ');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'Y;PfM~+cT(^ibz@3bG-e~(x<Ab4ID@cQVMC^sqO;#N1u8]wT{zWJJQ)Hv1d49p+X');
define('SECURE_AUTH_KEY', '%=co|p5it*f_;,TdT:#DO4%aVx,]Kv@:{*W/NtsVS)OywSY:$R]{eX0a7#k<w{~v');
define('LOGGED_IN_KEY', 'Vc`4&udHwGw9D(}H=.X7rPJ$5{I@Ie;T`o :NuMn_RuYXmWjuD=?GF?^l$<2_aGR');
define('NONCE_KEY', '._fl/[2qmaD$xW+)!na-2qQbsAa*AB$6B={UYiAR,A|%61*U%C!e:fTICtKPvxl;');
define('AUTH_SALT', '5}|v/i}*:ugwG|Sh]U#Hf/?Q23/ZO1v<h6W>7pDx4{5},6&W+NZ)|<&yI$FU2ANR');
define('SECURE_AUTH_SALT', 'N@+W-NKI]vHdtZ[i=UV2b01tuL!,U&YZ}xH0+V8Tq~xv&;Y<Cxk,!`j1W]pf?hXS');
define('LOGGED_IN_SALT', 'cQ3AoO*a}0U/f%[MqH^U%;83-<.!B )B*OLyP<.*fg2w k39zQC3H#<r5V7h,nzF');
define('NONCE_SALT', '<b4$^SZ)8r1}F>*1aDYyJ6X$sF=F=H*dLfsrMvQ+cLfpKB6]GL&i0m8P6ab[a`TZ');
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/****************************************************************************/
/* Multisite Configuration */
/****************************************************************************/
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'mylocal-copy.test');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
/****************************************************************************/
/* General WordPress Settings */
/****************************************************************************/
define('WPLANG', '');
define('WP_DEBUG', true);
define('WP_CACHE', false);
define('WP_DEBUG_LOG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
Thanks!