• I have a friend with a website (http://www.ancientempires-tours.com) that was built with WordPress by someone who is not friendly to my friend anymore. We decided to move his site to my server. I copied all of the files from his current server and created a subdomain (egypt.aragren.com) to test the site on my server. The result was an error message, “Error making a database connection.” I installed a new copy of WP to the Egypt folder on my server. The result was a page that was evidently auto-created by the WP install. We do not want to build the whole website from scratch. How can I get the existing website back up on my server.

    I guess whatever we do, I will have to repeat the process once we move the Domain to my server.

    I have never used WP and I know I am missing something essential in my understanding of what WP is for. I would appreciate any help understanding what is happening and what I need to do to make my friend’s website work on my server.

Viewing 15 replies - 1 through 15 (of 25 total)
  • If you open wp-config.php at the root of the site, you should see the details for the database name, username, and password. Make sure those match the details for your fresh WP install.

    Also did you import the database over from the other server? If so you may need to change the values for the URL and Homepage within phpmyadmin

    Thread Starter Rodtsd

    (@rodtsd)

    Thank you for the reply. The wp-config.php file is empty. All it contains is the normal basic components of a webpage. (html, head, body, etc.) Nothing but the section markers. The same is true of the wp-config.php file in the fresh install.

    I am not familiar with phpmyadmin. I need more details.

    I would like to make this work. I hope everyone will be patient with me and help me get through this.

    Thank you,

    The wp-config.php file should not be empty. That’s what connects the site to the database, which is probably your problem. It should look something like:

    /** MySQL database username */
    define('DB_USER', 'wordpress_wrd1');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'dnieohyrTBa');
    
    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    With a lot of other stuff in there too. If the file is empty then download a fresh copy of wordpress from wordpress.org and upload the wp-config-sample.php (rename it to wp-config.php) to the root of the install. That means at the very base, where you can see the wp-admin, wp-content, and wp-includes folders. Change the above values to those of your fresh WordPress install.

    Or if you don’t know the above values you could scrap that whole install and install it fresh again

    Thread Starter Rodtsd

    (@rodtsd)

    Okay, I was opening wp-config.php with a webpage editor. I opened in in a text editor and see all the things I should see.

    Now I need to find this database. Where do I find the database and what will its name look like?

    Ok you said you installed WordPress on your server right? Did you use the control panel for your hosting company to do that? And if so who is your hosting company?

    Thread Starter Rodtsd

    (@rodtsd)

    Yes, I used cPanel and installed from the source the server provided, Softaculous. My hosting co is Webhostingpad.com

    Quick question: were you able to access your site at all after installing WordPress? When you say you uploaded the files from the old server to the new, what files did you upload? Was it just the contents of wp-content or was it everything? You probably didn’t manually import the database did you?

    Also are you able to view the wp-config.php file on the old server? If so can you compare the database username and password on both?

    Thread Starter Rodtsd

    (@rodtsd)

    Going to the site brings up a page created by the install of WP. It has the name of the page that I gave to WP during the install.

    I uploaded all the files that were on the old server. There were over 2800 files. I have both wp-config.php files. I am guessing I need to put the new username and password into the old wp-config.php. Is this correct? Then I am guessing I will replace the new wp-config.php with the modified (updated) wp-config.php.

    Am I on the right track?

    I am still not sure where to find the database.

    Ok so what you should have done was install WordPress using cPanel, and then only upload the contents of wp-config to the server. I’m guessing you uploaded everything though, and probably overwrote the new config file with the old. My guess is the site is looking for the database at the old server.

    I don’t really know how you can go about getting the password to your new database, and you’ll need to know that to connect to it.

    Can you just scrap this install and do it over again? Only this time only uploading the wp-config folder?

    To get to the database: log into cPanel, navigate to phpmyadmin (will be around other database related icons). Click on that. In the small left hand column click on the database name and that will load the details of it. Then you can click on “wp-options” in the left menu, and then the “browse” tab across the top. One of the very first lines should be the site URL. But that’s probably going to be fine. I think your issue is a bad wp-config file, not the database.

    Oh! I may have found it. Log into cPanel and look for MySQL Databases. Click on that.

    Scroll down to:
    MySQL Users
    Add New User

    And create a new username and password. Then:

    Add User To Database

    Select your new user from the drop down menu, and select your database from the second drop down menu.

    Now you should be able to go into your wp-config.php file (in the new install) and change the database name, user, and password to your new values!

    Thread Starter Rodtsd

    (@rodtsd)

    I think we are confused by the order in which things were done. Here is the order I used:

    1. Uploaded copy of all the files and folders from the old server to the new.
    2. Installed WP

    That is about all I have done. I also have a backup copy of the original files from the old server. I have both the old and the new config files.

    Hm. Can you give a URL to the site?

    When you open both config files, are the values the same?

    Thread Starter Rodtsd

    (@rodtsd)

    http://www.egypt.aragren.com is the new site. It should actually look like the real site, http://www.ancientempires-tours.com.

    I will compare the 2 files and let you know.

    Oh my gosh. I’m so sorry. I thought you were stuck at the error message. Ok nevermind, all is well. Here’s what you do:

    Log into the back and go to “Appearance”. That will give you a list of available themes. Select your actual theme from there and activate it.

    Log into the old site and go to “Tools–>Export”. Download the export file.

    Log into the new site and go to “Tools–>Import”. Upload the file from the old site.

    That will import all of the pages and posts!

    Thread Starter Rodtsd

    (@rodtsd)

    the 2 config files are quite different. I guess I do need to find the original DB and make sure it is on the new server. Its location is listed as /** MySQL hostname */
    define(‘DB_HOST’, ‘ancientempirestoursc.ipagemysql.com’);

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Transport site to new server’ is closed to new replies.