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:
- Multiple WordPress instances with multiple databases
- 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.
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.
Than click on “Get WordPress” button, top right corner.
Click on “download and install” link, and new window will displayed.
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.
After unzip, new folder “WordPress” appears.
All WordPress files are in folder “worpress”. Now, we can delete “wordpress-5.8.2.zip” file.
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.
Than scroll down to the DOMAINS section and click onto Subdomain button:
Fill all fields on Subdomains screen. Only one field must be filled: Subdomain name. Than pick domain name.
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.
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:
Write down flowing data:
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.