With an urge to learn more, you must understand the concept of backing up a subdomain. Most of the WordPress users don't have any idea about the difference between a domain and subdomain.
A domain is an address where internet users can access your website. Computers use IP address to identify a website, but it’s not possible for humans, so the simple identity having character and numbers is a used.
Every domain name is unique. Let's say you have a website (example.com), this is a domain name.
A subdomain is created using the primary domain; you may have noticed, many websites have a separate blog or forum section.
For example blog.example.com, forums.example.com, these are subdomains. I would like to mention that some subdomains are used for a different purpose, for example, mail.example.com is used for emails and there is no CMS installed.
The process of backing up a subdomain is applicable when you run a website on it. To backup a domain and its database, you can use the full backup option from cPanel, but when you have a subdomain, you require to take manual action.
Although you can download the full backup of the home directory and then extract your subdomain folder, it can be complicated.
In this tutorial, you're going to learn the manual method to backup your subdomain.
Backup the Website Files and Folders
As you already know, a website contains its files, folder, and database, you need to backup everything up. To back up the website data, you require to access the file manager.
To do so, follow these steps.
Log into to your web hosting account and open cPanel. You can easily find the File Manager icon under Files.
Click to open.
You may see an empty directory because you may be seeing the home directory. Your website is hosted on the public_html/root directory.
Open it from the vertical navigation menu showing at the left.
Search for a folder with the name similar to your subdomain. As you can see, there is a "blogforportfolio" folder in the directory, you have to compress it.
Note: The folder for your subdomain will be different, I am showing you an example.
Right-click to compress, you can also choose the Compress option showing on the main navigation bar of cPanel.
A popup will appear, you have to choose the file type, choose the radio for "Zip Archive". Click on the Compress File(s) button.
You can see the percentage of the compression for all the files and folders of your subdomain, close it and refresh the page.
You can easily find the ZIP file to download. In my example, it's blogforportfolio.zip. To download, right-click and choose download.
You can also download by double-clicking.
Depending on your internet speed and the file size, you can have the backup on your computer to keep it safe. You can use it while migrating to a different server.
Well, the backup is incomplete without its database.
Start Backing Up the Database
Even though you have a subdomain, you can backup the database through the backup wizard. But it's important to learn the manual method.
Let me start the process.
After logging in to your cPanel, you need to open phpMyAdmin. You can easily find it under Databases.
A new page will appear to you. As you already know, there will be multiple databases, and you need to select the one which is associated with your subdomain.
Select it from the left-side vertical navigation menu.
Many databases will appear to you, to back up, you have to export the database using the option showing on the main navigation menu of phpMyAdmin.
Click on Go button and depending on the size of your database, you can have it on your computer within a few minutes.
Congrats, you have successfully backed up your website and its database. Now, you can use them to migrate your website to another web hosting.
If you think the size of your database file is too big, you should consider optimizing the database on the regular basis, this is a tip to improve your website's performance.
Can You Now Backup Your Subdomain
If you follow the steps, you can have the backup files on your computer within a few minutes. Not everyone has the website with the size of 4GB.
Most of the users have the website under 500MB, but the database size can vary. If you want to backup everything available on your web hosting server, you should try the full backup option.
Extraction of the subdomain folder can be a little bit tricky for a non-techie user, but eventually, you can do it.
I hope you have understood the steps, if you think you can follow the manual method, you can also use a backup plugin.
But I suggest you be safe and learn these basic steps to backup your website.