I have done the following steps (see below) to make an exact copy of my multi-site WP that I can use for testing. My main site is located at sudsol.org/member and my 2nd site at sudsol.org/member/articles. I’m setting up the new site at sudsol.org/stage2 and my second site then at sudsol.org/stage2/articles. I’m creating the duplicate copy at sudsol.org/stage2 (and the second site then at sudsol.org/stage2/articles.
I can access the main site fine (sudsol.org/stage2), but I’m having problems with the second site (sudsol.org/stage2/articles). When I activate multi-site in the wp-config file, I get the following error: Error establishing a database connection and can’t access anything. When I delete the multi-site lines from the wp-config file, I get back to the main site fine.
Here are the steps I’ve followed:
1) Installed wordpress in a new subfolder sudsol.org/stage2 (selecting multi-site install)
2) Copied wp-content themes, plugins & uploads from the live site to the /stage2 files (replacing everything that was there for themes, plugins & uploads under wp-content).
3) Deleted the DB that was created when WP was installed using My SQL Databases in C-panel.
4) Copied the database from the live site to a new database using PHPMyAdmin (Operations, Copy Database to:, selected Structure & data and to Create database before copying & Auto-increment value check boxes are checked).
5) Added a user to the database giving all privileges.
6) Edited the database using SQL to change the URLS to the new site (for both sites sudswp is the main site sudswp_2 is the second site:
7) Edited the wp-config file for DB_NAME, DB_USER, DB_PASSWORD & table_prefix to be correct.
At this point I can access the main site and everything is working. The second site gives me a 404 page not found (as I would expect since Multi-site is not yet activated in wp-config)
So then I continue to activate Multi-site:
1) Add define( ‘WP_ALLOW_MULTISITE’, true ); to the wp-config file & FTP it to the site
2) Deactivate all Plugins
3) Go to WP Admin -> Tools -> Network Setup and get the info to copy to the wp-config & .htaccess files. The .htaccess file is already identical to the information provided
Added the following lines to the wp-config file:
Now when I try to access the site, I get the Error establishing a database connection message – even when trying to access the main site at sudsol.org/stage2
If I remove the multi-site I can get back to the main site fine.