Multiple WordPress instances One database
|

How to set multiple WordPress instances on single database

Spread the love

What to do in case we need to install multiple instances of WordPress, but we are limited to one database? Is it even possible to do multiple WordPress Installation using a single database?

The simplest answer is: YES it is possible.

There are two approaches to multiple WordPress installations:

  1. Multiple WordPress instances with multiple databases
  2. Multiple WordPress instances with single database

In our case it is obvious that we’ll use approach number two: Multiple WordPress installation with single database. Unlike a single WordPress installation on a single database, in the case of multiple installations of WordPress with a single database the installation procedure must be done manually.

WordPress multiple installation using single database

Step 1: Download WordPress

We have one WordPress instance already installed onto server, and it’s using one database, and that one database is only one witch we have available. The first step before start installation of second WordPress instance is to download it. Download and manual installation is necessary if we are using only one database.

Type “wordpress.org” in your internet browser’s address bar.

WordPress Multiple Installation Using a Single Database: download WordPress

Than click on “Get WordPress” button, top right corner.

WordPress Multiple Installation Using a Single Database: download WordPress

Click on “download and install” link, and new window will displayed.

WordPress Multiple Installation Using a Single Database: download WordPress

Select “Download WordPress 5.8.2” and wait until download finish.

The current version of WordPress that is available at the time of writing this article is 5.8.2, in your case can be different. The only important is to download latest version of the WordPress, and download it from official wordpress.org site.

Once, download procedure is finished, open your download folder, and unzip the downloaded file.

WordPress Multiple Installation Using a Single Database: unzip WordPress installation folder

After unzip, new folder “WordPress” appears.

WordPress Multiple Installation Using a Single Database: unzip WordPress installation folder

All WordPress files are in folder “worpress”. Now, we can delete “wordpress-5.8.2.zip” file.

WordPress Multiple Installation Using a Single Database: WordPress installation files

We will upload these files to the server later.

It is not necessary to unzip WordPress instalation zip archive before upload it to the server. Most of servers has unzip option. But, some times that server’s unzip options does not work as we expect. The difference between size of WordPress zip archive and unzipped files is not so big and does not make big difference on upload time.

Step 2: Install WordPress as subdomain or subdirectory?

For the WordPress installation process itself, it doesn’t matter we install it in a subdomain or a sub folder. A subdomain or sub folder is more a matter of SEO than WordPress installation itself. In both cases the installation procedure is the same. The difference is the only name of the installation folder name.

If we decide to install it in subdomain the folder, where we will upload files, will be e.g. “subdomain.sitename.com”, or if we decide to install WordPress in subfolder the folders’s name will be e.g. “sitename.com/subfoldername”.

In our case, we will install WordPress in the subdomain.

Step 3: Make subdomain

Depends of you hosting provider the procedure of subdomain creation can be different. Relatively common is to use cPanel. First, you need to login on your cPanel account using your user name and password.

WordPress Multiple Installation Using a Single Database: cPanel LogIn

Than scroll down to the DOMAINS section and click onto Subdomain button:

WordPress Multiple Installation Using a Single Database: Subdomains

Fill all fields on Subdomains screen. Only one field must be filled: Subdomain name. Than pick domain name.

WordPress Multiple Installation Using a Single Database: Create Subdomain

Document Root will be filled automatic and by default will be: “SubdomainName.DomainName” you can live as it is or you can change it. In any case, leave default or change it, the Document Root represent the folder name of your subdomain or in other words, all documents of your subdomain will be located in folder with that name. The subdomain will be created by clicking on Create button.

Step 4: Install WordPress

Navigate to Files section in cPanel and click on to File Manger button to open file manager.

WordPress Multiple Installation Using a Single Database: Copy WordPress files

In left hand window of the file manager find and open file with name of Document Root created in previous step (during subdomain creation procedure), and copy all WordPress files downloaded and extracted in first step.

Before continue with installation it is necessary to collect some data. First open already installed WordPress instance at main domain, find and open wp-config.php file. Scroll down little bit and find next section:

WordPress Multiple Installation Using a Single Database: wp-config.php, database information

Write down flowing data:

  • DB_NAME
  • DB_USER
  • DB_PASSWORD
  • DB_HOST
  • table_prefix
WordPress Multiple Installation Using a Single Database: wp-config.php, database information

Edit “wp-config.php” of new WordPress installation (subdomain) in course to fill DB_NAME, DB_USER, DB_PASSWORD and DB_HOST with data same as in “wp-config.php” file of main domain WordPress installation. Only “table_prefix” must be different.

Than type in your browser’s address bar: “subdomain.domain.name/index.php” WordPress installation screen will appear.

Next steps is the same as normal WordPress installation.

Similar Posts

Leave a Reply

Your email address will not be published.