Title: Error connecting to database
Last modified: September 8, 2021

---

# Error connecting to database

 *  [dieterh](https://wordpress.org/support/users/dieterh/)
 * (@dieterh)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/error-connecting-to-database-11/)
 * A friend of mine has a WordPress-based website (ficticious name: [https://HISWEBSITE.com](https://HISWEBSITE.com)),
   hosted in a provider’s data center. Version of WordPress: v5.8. The website is
   fully functional, no problems at all.
 * He asked me to extend functionalities of his website (e.g. multilingual, etc.).
   In order not to impact (destroy) his current website while extending functionalities
   I tried to clone his website onto my URL (fictitious name [https://MYWEBSITE.com](https://MYWEBSITE.com)).
   I have FULL control of the computer which runs MY website. Having also FULL administrative(
   WP-based) control over my friend’s website I took the following steps:
 * 1. Backup of my friend’s website including a dump of his database.
    2. Transferring
   all files to my computer. 3. I Installed WordPress v5.8 on my computer 4. I copied
   ALL files from the backup (step 1) into /var/www/html/**myFriend** 5. In MySQL
   I created a database (same name as on my friend’s website) 6. In MySQL I applied
   the untouched MySQL dump file (step 1) to the database just created. 7. In file**
   wp-config.php** I replaced a) Name of database „rdbms.provider.com“ to „localhost“
   8. I restarted the web server (Apache2): no problems 9. URLs a) My friend’s website
   is invoked by „**[https://HISWEBSITE.com](https://HISWEBSITE.com)**“ b) My website(
   with respect to the cloned stuff) has to be invoked by „**[https://MYWEBSITE.com/myFriend](https://MYWEBSITE.com/myFriend)**“
   10. When trying to access my friend’s cloned web contents from MY website (by
   entering „**[https://MYWEBSITE.com/myFriend](https://MYWEBSITE.com/myFriend)**“)
   the URL in Mozilla Firefox changes to „https://HISWEBSITE.com/myFriend“, i.e.
   the components of the URL get intermixed. Of course, this results in an error.
   Firefox access my friend’s website but cannot find subdirectory “myFriend”.
 * Questions:
    1. What do I wrong? Which other files have to be modified? 2. Where
   is the token „HISWEBSITE“ stored in the CLONED data on MY computer? 3. Are there
   other alternatives for cloning a functional WP-based website (NOT moving it!!).
   Please note: Cloning is done for experimental work). I also checked with Linux
   grep to locate occurrences of “HISWEBSITE“ but could not find them. 4. I searched
   the internet but I could not find a clear and sober tutorial for cloning / moving
   a WP-based website. Many tutorials seem to be superficial, not having been created
   in the context of a real need for cloning or in the context of a failure.
 * Could you point me to a „good“ and exhaustive tutorial, please? You may also 
   point me to a Linux script which does the job.
 * Thank you very much in advance.
    Best regards Dieter

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [corrinarusso](https://wordpress.org/support/users/corrinarusso/)
 * (@corrinarusso)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/error-connecting-to-database-11/#post-14852301)
 * – Check the table_prefix constant in your wp-config file.
    – Check the siteurl
   and sitehome values in the _options table of your database. – Check your apache
   to see if you need a port number to connect to the db, i.e. localhost:8080 – 
   Check your path settings in apache to make sure your folder is in the right path(
   i.e. //path/folders/www or htdocs, etc – start over, and just use a migration
   script: [https://en-ca.wordpress.org/plugins/all-in-one-wp-migration/](https://en-ca.wordpress.org/plugins/all-in-one-wp-migration/)
 *  Thread Starter [dieterh](https://wordpress.org/support/users/dieterh/)
 * (@dieterh)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/error-connecting-to-database-11/#post-14856315)
 * Hi corrinarusso,
 * thanks a lot for the checklist. I ran through it, no errors found so far.
    I’m
   going to work with the plug-in mentioned in the URL (migration script).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error connecting to database’ is closed to new replies.

## Tags

 * [connection](https://wordpress.org/support/topic-tag/connection/)
 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [dieterh](https://wordpress.org/support/users/dieterh/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/error-connecting-to-database-11/#post-14856315)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
