Move website from subdomain to main domain
If you are testing different content management systems or trying out new features, you should not do this on your production website. That's why subdomains are often used for this purpose, to test and try out separately from your live website. Without accidentally ruining your main website. In this blog post, let's take a look at how this works. And how to then move a subdomain to your main domain.
Subdomain - separate environment for testing
Testing is an ongoing process for many websites, especially for business and organization websites that often last for several years. And they are not abandoned after just one year. The longer a site exists, the more people think about trying a new layout or a different way of working. Maybe you can get more sales with a different system, or you can offer more functionality to your customers. Testing not only the website, but also the underlying techniques can therefore be important for you, your employees, your customers, and therefore the entire company.
The result for testing a website is in many cases a subdomain. This subdomain can be made accessible on the web or shielded for local testing. You can restrict access based on your IP address to protect it from prying eyes. With a subdomain, your main domain is not compromised. The files are stored separately, so you can edit them as you wish. You can also create your own database and user for it, and thus a completely new website.
Of course, this is not the only option, and many users also use a locally hosted website or one on Github. A subdomain is easy because you have the entire toolset at your disposal and can work as usual in the hosting of MijnHostingPartner.nl.
Main domain - the live or production website.
The main domain is of course where your main website runs, on this website you recruit new customers, sell your products or offer your content. When creating a new website, you want to avoid downtime and error messages as much as possible. A subdomain is the solution to keep your main domain secure during development. Seal it off from others by blocking the IP addresses that are not used by you. And do this until you are satisfied with a new system or website.
The next step, of course, is to move your subdomain to the main domain. This can be easy, but in any case it requires your full attention. Because there is still a lot to do.
Procedure for moving a subdomain to the main domain.
Moving a subdomain to a main domain is a process for which you need to make some preparations. For example, try to place a banner on your website for a few weeks with the date of the move. And share this on your social media channels. It is also advisable to carry out such work at night, or in any case, at times when your users are least likely to be inconvenienced.
You should backup your old website by making a full backup of all files in wwwroot. And of course the database.
After that, you only need to backup the database and the subdomain files. And then compare the two websites. Ask yourself the following questions: what is the URL structure in the main domain and does it match the new subdomain? If there are a lot of 404 messages when querying old URLs, this can have serious implications for your Google ranking. You can further check and note this in Google Search Console. URLs that no longer exist can be linked to a new alternative.
After moving and arranging the files in the main domain, you still need to import the correct database and adjust the configuration files to the new data if necessary. It is also often necessary to adjust the URL of the website. This can be easily done within WordPress using the database.
Many of these steps can be found in our knowledge base, where we have written extensive articles over the years and continue to add more articles and updated information each month. The information is also site-specific and cannot be lumped together for every site. So it may be different for you than for others. So don't just replace a website, because that can have long-term negative consequences that you may not discover until late in the process. For this purpose, website scans can be performed so that problems come to light faster.
So prepare well and do your homework before moving a website.