If you want to know how to move a WordPress site to a new domain, then please see our section below, that will give you a brief overview of the steps involved. We hope to write a detailed article soon to replace this overview.
If you are looking for developing a new WordPress website on the same server then we cover this first.
How to develop a new WordPress site on the same server
So you want to view your new website without putting it live & it’s on the live server!
This is one of the trickiest situations I have. It generally occurs as my clients want to upgrade or re-brand 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.
How to develop a new WordPress site on the same server
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.
Avoid this, as it can go wrong
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.
Do this to keep it smooth
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 sub-domain 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 sub domain dev it made that link an active one with an assigned IP address. You can host multiple sites on the one account
Installing WordPress on the dev.domain.com
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 isn’t, 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 name servers 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.
Now you ask how to move the WordPress site when its ready to go live. Lets take a look at this next.
Ready for WordPress 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
- This would involve moving the files from /home/domain/dev.domain.com to the /home/ domain/public_html folder.
- Then use a search/replace tool like https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ to replace all the references to dev.domain.com with 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.”
Moving a WordPress Website to a New Domain
Many of our visitors ask how to move a WordPress site to a new domain. Although we didn’t initially cover this in our article, its evident many of our website visitors need some overview on this.
First, you need to create a backup of your website, both your web space files and your database.
Download the files of your website using an FTP connection. This is normally provided by your web host company. If you don’t have the details then ask them to provide you FTP access. I then use Filezilla software to connect. Its free and very simple to use. Connect to the server and save all your files to your local computer. Make sure you save a copy of the files in a separate folder on your computer to keep as a backup. Export your database with phpMyAdmin and save a copy of the exported sql-file in a separate folder on your computer as a backup.
Backup and keep safe first
Now you have backed up everything. Keep these files safe, so you can return to them if anything ever goes wrong.
Upload files to your new domain. Again use an ftp connection, but this will be to your new domain URL.
Import the backup of your database to phpMyAdmin.
Once your database has been imported, locate the table called wp_options in the menu phpMyAdmin menu. Locate site URL and home and change these to your new domain. Check all the links and Urls are correct for images and links.
Now go through your new domain site and double check everything. I always use the search/replace tool from interconnectit.com to replace all the references.
This is a brief overview and is not by any means as detailed as I would like. If you do need this done for you, I can provide consultancy and arranged to do this for a small fee, just contact me directly.