This is one of the trickiest situations I have. It generally occurs as my clients want to upgrade or rebrand their website templates and they are already hosted with me. Its a nice problem to have as its a sign of customer loyalty. But it is a lot trickier than if they are already hosted on previous server and moving across. That would just be a case of developing the new website on our servers and giving them a link to view it which is limited accessing using cookies.
The Brief: So lets take the issue in hand today. How to help a client who wants to have a new site developed on his server while the old website remains live Let’s presume in this example the live site is www.domain.com The new site needs to be available for viewing to some selected clients.
It’s tempting (but not the best practice) to set up a new hosting account and then point the live domain to a new account on the server. Then install a new WordPress site, add templates and get the site looking good, with the idea when its fully approved we can switch the live domain across. Then use a “search and replace” to resolve any URL issues.
It’s best developing the new version of a website on something like dev.domain.com In that way the search and replace will only need to remove the dev. bit of the URL.
Step 1. Go to your hosting cPanel account for domain.com
Step 2. Go to domains and add a subdomain dev….see screenshot below
So the purpose of the dev.domain.com is to develop the site side by side with the live one, not resulting in downtime. For the users to see the site they just need to go to dev.domain.com in their browser as they would with any other site.
When you created the subdomain dev it made that link an active one with an assigned IP address. You can host multiple sites on the one account
If you want to install a new WordPress install you can either do this through FTP and locate dev.domain.com on the domain root, or if you have Softaculous, you can see a drop down with dev.domain.com
So in summary: The new web area has its own folder called “dev.domain.com” where the files go and any changes made to the live site www.domain.com will not effect dev.domain.com and vice versa.
Take a look at this screenshot as we have a couple of points to cover regarding protocol and directory.
1. protocol – If eventually you intend the domain to be https but it currently isnt, then set it to http:// As it will likely run into the insecure warning issues if you set it to https://. Leave it as http:// until you are ready to go live, then install Really Simple SSL to do the work for you.
2. directory – If you normally have directory empty so wordpress is in the root directory, the directory box can be left blank, as you are choosing the dev.domain.com domain as your URL it will install all WordPress files in the dev.domain.com folder
If domain.com is using other nameservers than your local hosting, you will need to get them to add the dns record for dev.domain.com and point it toward your IP address. This should take effect immediately as it’s a new record.
As we will need to show the site before it goes live, we will need a development domain for the client, but it’s not a bad idea to restrict the site access to avoid others discovering an unapproved site, so it’s worth looking at this article.
That’s it until you ready to go live.
Best practices if you do it manually. I’ve not used this, but you can try using a plugin like Duplicator to move the files across. This is a popular and well documented plugin for cloning and moving WordPress sites.
1. Do a full backup of the server and both the live and new websites – include all files and databases, just in case!
2. Then search and replace all references of dev.domain.com to domain.com
3. The existing domain.com website files need to be removed from the public_html folder (document root of domain.com). You may also need to replace references to /home/domain/dev.domain.com with /home/domain/public_html.
In the finest WordPress Install Words…Zanet Design
“That’s it, were you expecting more steps? Sorry to disappoint.”