• I have installed WordPress (manually, following the tutorial at https://www.siteground.com/tutorials/wordpress/wordpress-installation.htm) on my server in the /beta directory (mydomain.com/beta). Finished the design and then I was asked to present another version of the website. So I created a /beta2 directory on the same server (mydomain.com/beta). I *again* ran the WordPress installation following the same tutorial, uploaded all of the WordPress files in the /beta2 directory, created a new database and started working in it. Then to my horror I discovered that the website I had created in /beta directory is no longer there. I cannot open or view it anymore, although all of the files seem to be in place. I wonder if I made a mistake by installing WordPress anew in /beta2 and how I can restore my first website in /beta. Any ideas? Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • That tutorial has been moved.
    Suggest that you use your website file management to check and BACKUP your theme customisation from the first site. They should be in:
    beta/wp-content/themes and whatever rour theme name was.
    also backup:
    beta/wp-config.php

    Where the wordpress files there ?

    Now go into your database manager. Are there two databases ?

    Check the file:
    beta2/wp-config.php

    Does it specify a different database ? Different table prefix ?

    What you find answering the above questions will inform your corrective actions.

    Thread Starter tproud

    (@tproud)

    Hi Ross, thank you for your help. I have checked both wp-config.php files and there are different databases specified there and different database user names. However, when I went into my database manager, while there are two databases, one of them (the first one, for /beta website) does not have a user. What should I do now – create the user with the username specified in the wp-config.php file for the first website?

    Thread Starter tproud

    (@tproud)

    OK, I have tried to add the username specified in the first website’s wp-config.php and it wouldn’t work, so I added a new user and assigned it to that database and changed the wp-config.php file accordingly. Still no luck. Can’t open the first site.

    About the table prefixes – my databases are called sa21720_wp and sa21720_wp2. Is that the right way to name 2 different databases? And most important – what should I do to restore the first website at this point? Thank you.

    Thread Starter tproud

    (@tproud)

    Oh – and I have checked table prefixes – they are identical for both databases. Should I correct that?

    Good work, you are giving me very useful information.

    • * The lack of a user is a problem.
    • The distinct database names are correct, the names are informative.
    • The identical table prefixes is ok, though they are most likely “wp_” which is not ideal, best practice is to make the prefix unpredictable as a protection against a common style of attack.

    As an asside, does you hosting plan permit you to run two databases ? two WordPress installs ?

    You need to create a user who can use the first database.
    If you are using cPanel then the program to do this is “MYSQL Databases” (NB: nearly all other database ops are with phpmyadmin).
    Using this tool try and create a new user, attach them to the first database, assign them ALL priveledges on that database.
    Then put this user’s name and password into wp-config.php, if this works you are done.
    Otherwise if you are unable to create a new user, then try and give access to the user for the 2nd database, make sure you are adding rather than replacing the database, again grant all priveledges. Again update wp-config.sys, there is no problem that the same user can access two databases.
    If this does not work then you need to contact your hosting support.

    Thread Starter tproud

    (@tproud)

    Thank you so much for all your help but it still doesn’t work. Another thought: what if I try to copy the entire contents of my /beta directory to the other directory, for example /new. Would I need to create a new database for that?

    Thread Starter tproud

    (@tproud)

    Actually I am beginning to wonder if having identical table prefixes might be the problem here. Here’s what the wp-config.php files says:
    * You can have multiple installations in one database if you give each a unique prefix.

    Should I try to change one of the table prefixes? I found this guide: https://www.icontrolwp.com/2012/11/changing-wordpress-database-table-prefix-security-obscurity/.

    what if I try to copy the entire contents of my /beta directory to the other directory

    Good idea, everything EXCEPT wp-config.php this is that only file that gives the site its identity.

    Actually I am beginning to wonder if having identical table prefixes might be the problem here. Here’s what the wp-config.php files says:
    * You can have multiple installations in one database if you give each a unique prefix.

    While this is true, it is not relevant if they are in different databases. Though having different prefixes is a good idea for other reasons.

    Yes there are plugins that can change table prefix.

    Thread Starter tproud

    (@tproud)

    Great, thanks! OK, I have copied the files to the other directory (minus the wp-config.php file) and now what – do I create a new database to finish the installation, or do I specify the database data I used for this installation originally?

    Use the database settings in the wp-config.php file.

    This will only have a chance of working if you have recreated that database user.

    Thread Starter tproud

    (@tproud)

    Oops, doesn’t work. After I submitted the database information, I got this:
    *********************
    Already Installed

    You appear to have already installed WordPress. To reinstall please clear your old database tables first.
    *********************

    And the Log In button which produces a blank page when I click on it. OK then, I give up. Well I guess stuff happens. Thank you so much for walking me through this, Ross!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Multiple WordPress installations on a single server’ is closed to new replies.