Good day together, as the title mentions, i want to clone a local wordpressmultisite(i use xampp) to another directory. the first existing mutlisite runs under xampp on http://localhost/Wordpress. the second blog of this wpms can be reached under http://localhost/Wordpress/buddha. this multisite is working fine.

Now i want to run a copy of this multisite installation under http://localhost/wp-buddha. So i copied all files and directories from the htdocs/Wordpress directory of xampp and paste it in a directory named wp-buddha ind the htdocs of the xampp directory.

In the next step i created a new databse named buddha by using myphpadmin on localhost. i created also a user for this database named buddha with the passswort buddha.

then i exported all tables from the first multisitedatabes to a sql file and imported the sql file in the nwe buddha databse.

I changed in the new multisite the databse informations such as databasename passwort and databaseuser to the new one.

Now, i my understanding, wordpress should be able to connect to the new databsse called buddha, even if the paths of the subdirectories are not actual.

But when accessing the site over http://localhost/wp-buddha there appears: Error establishing a databse connection.

I tested the databse informations with a php-script: they arte correct. Can anybody give me a clue why tha database connection isn´t working properly? thanks for any help.

1 Answer 1


Thanks for sharing the issues. I will share you how can you move the wp website another folder. Please follow my instruction step by step.

Step 1: Copy the all source code this folder location "http://localhost/Wordpress/buddha" file. Step 2: When you copy all file then Pleas paste the all source file this folder location "http://localhost/wp-buddha". Step 3: Create a new database from "http://localhost/phpmyadmin". Then import the database. Step 4: Open the config.php file and change the only database name.

define('DB_NAME', 'write_db_name_here');

/** MySQL database username */ define('DB_USER', 'root');

/** MySQL database password */ define('DB_PASSWORD', '');

Step 5: Please go to the database table "wp_options" change the URL link.

Please follow the screenshot instructions. Hopefully, it will be working fine.


  • thank you for your effort! I did the things step by step as you described but nothing changed. I think you provided to create a new database and dont setting passwort or user so that root is set as the default user and '' as the default paswort, so i just have to change the name of the database. But as i mentioned before, i cheked the log in details for the database by a php script. and they are right. i did the things you describe so many times(at least 10x) but the error still remain the same .
    – user162820
    Mar 10, 2019 at 15:42
  • Thus there must be other reasons why wp can´t connect to the database. i also wrote this after the opening <?php tag: die('hello world'); to test if wp accesses the right wp-config file. The result: it does!!! instead of loading anything or to display the error message error establishing a databse connection there is displayed hello world after accessing the site under localhost/wp-buddha
    – user162820
    Mar 10, 2019 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.