Website migration can be overwhelming if you don't follow the correct procedure. Most of WordPress users complain of losing their website's content while transferring it from one place to another.
The main migration takes place when you decide to switch web hosting companies. Sometimes, you might need to move the website's data from one folder to another.
Most of the time, when you host a single website, the data remains in the primary/root directory, but if you decide to add an addon domain, changing the primary domain, you may in need to move everything.
I can't forget the day when I was trying to transfer my website from public_html to a new folder, and I lost everything because of not having the backup.
Well, it's always an essential step to take before you make any changes to your site. You shouldn't forget backing up the database.
In this tutorial, you're going to learn a step by step process to move your website from public_html to a new folder.
Learn to Play With cPanel and Transfer Your Website With No Pain
As I have mentioned, I am going to walk you through the website migration from the root directory to a new folder. The same process is useful even if your current WordPress installation is in a folder and you want to move it to the new one.
Note: Don't forget to backup the site and its database.
So, roll on your sleeves up and follow the steps.
Open the cPanel and search for the file manager, that's where all of your website's data is available, you can easily find it under Files.
Click to open.
It's possible that you may see the home directory, so navigate to the vertical menu and click on public_html. You can see many files and folders.
Before you proceed, it's essential to create anew folder, where you want to move your WordPress website.
Go to the main cPanel's navigation menu and click on the Folder icon.
A popup appears to fill in New Folder Name. In this example, I am filling in "new". Depending on your choice, you can choose any.
Some website owners like to move their old website to a "blog" folder or something similar. Click on the Create New Folder Button.
Note: While filling in the folder name, you can notice the location, it's in the public_html directory.
Now, refresh the page, and you can see the folder named "new." Now, you need to copy all the files and folders except "new," because this is where you need to move the rest of the data.
After selecting, either right-click or click on the Move icon from the main navigation menu.
A popup appears where you need to fill in the path. As you already know, the "new" folder is in the public_html directory; you require to add "public_html/new" as the path.
Click on the Move File(s) button. Depending on the size of the files and folders, the data will be moved.
How to Set the New Website URL
You have moved the complete WordPress installation from one location to another, and it means the main URL needs some modification.
Your old URL was https://www.example.com, but the new URL should be https://www.example.com/new
Note: Replace the folder name "new" with yours.
To do so, you need to edit the wp-config.php file, which is available in the new folder. Right-click to edit the file.
Define your site's URL.
Save changes and you're done.
Try checking your website, if everything works, congrats, you have successfully moved your WordPress site to a new folder.
Note: Sometimes, during migration, the image might get affected, to resolve, you can use the Velvet Blues Update URLs plugin.
If you see all the images accurately, no need to use the plugin.
Isn't that Easy to Transfer the WordPress Installation
Every time people read something techie, they fret instantly. Reading and analyzing is essential before asking help from others.
Most of WordPress users seek help from their techie friends or web hosting customer support; they can accomplish such simple tasks themselves.
During migration, you only need to make sure you don't delete anything. Sometimes, people might modify the folders.
Backing up the website and its database is always the first step to take. I hope you can easily move your site.
Check out these top 3 WordPress hosting services: