Migrating to WordPress Hosting: A Complete Guide
Jul 31, 2023
Are you prepared to transfer your WordPress website to a different host or server? It might be intimidating and difficult to move your website to a new hosting service, but it doesn't have to be. Although there are crucial steps involved in migrating your WordPress site, if you follow our instructions, you can succeed.
Many consumers are forced to switch hosts due to issues with their present provider since they've had enough. However, switching to a more dependable host is frequently postponed since you're worried about making a mistake and endangering your website(s).
People may pay a hefty sum to have a professional migrate their site for them in order to get around the issue. Alternatively, look for a new web host that includes a migration service in their new web hosting plans. The third alternative is to try it yourself, which is what some readers of this post choose to do.
If you take the effort to create your own website, migrating won't be a problem. If done correctly, it can be a relatively simple project that is simple to exit from if anything goes wrong.
Let's go over the steps necessary to transfer your WordPress website to a new WordPress web host, but before we do, please keep in mind that many of the best WordPress hosting companies will actually transfer your site for you. If you recently bought a new Wordpress hosting plan and are considering moving your site, check to see if your new hosting provider offers free migration first.
Step 1: Backup the files on your website.
The first step in any migration is to take a complete backup of your website. This is a wise practice before making any significant changes and should be a part of your overall WordPress security. But because there is so much data being moved, it is also a need of transferring your WordPress installation. How do you backup your website, then? You can use a variety of plugins to backup WordPress for you. You normally install a backup plugin and then use built-in settings to control which files are backed up, how frequently they happen, and where your backups are saved.
WPvivid is among the greatest solutions if you wish to use a plugin. This plugin provides a ton of strong backup features, including scheduling, restore points, file limits, huge file filters, backup splitting, backup themes, backup plugin compatibility with remote storage, multisite support, and more.
An alternative is to use a more manual method. You need a file transfer program (FTP) to access your website data in order to perform manual backups, to sum up. Transmit for Mac and FileZilla for PC are two well-liked FTP software. Following installation, you will want SFTP credentials (from your web host account) to connect to the server hosting your website. Once connected, choose and download every file located in the directory of your website. This applies to hidden files like the htaccess file. If you are unable to see this file, refer to the help section of your FTP program to have it display hidden files.
This could take some time, depending on how many media uploads you have on your website. Making a copy of your database can be started in step two while this download is still ongoing.
Step 2: Export the Data Base of WordPress
The process of exporting your database is straightforward and only involves a few steps. Open the phpMyAdmin program by logging into your web server's cPanel account. From the list in the left sidebar, choose the database that houses your WordPress installation, and then click the Export tab on the navigation bar. The Quick export's default options and the export's SQL format are adequate for our needs. The database export procedure will start once you click the Go button, and a file will be downloaded to your local computer. You are prepared to go to the next step once the database export and the FTP transfer of your files have both been finished.
Step 3: Setup Your New Host Server's WordPress Database
Before starting the transfer to the new web host, we must set up a location for installing WordPress. You must establish a database that you can import your SQL data in order to accomplish this.
Utilize the login credentials they have provided you to connect to the cPanel program at your new web server. We shall use the MySQL Databases application for our guide. If your web host doesn't currently run that application, you need to get in touch with them to find out how they go about building new databases.
A database can be created in a few easy steps:
Create a new database for your website by opening MySQL Database and giving it a suitable name.
Make a new MySQL user and give it a strong password.
Give this user account All Privileges and add it to the new database.
Note the password associated with it, the new MySQL account, and the database name. You'll soon require them.
Step 4: wp-config.php file Editing
Go to the local computer location where you downloaded the website files. A file named wp-config.php, located in that folder, manages access between WordPress and your database.
This file should be duplicated and kept on your local computer in a different folder. This is essential in case something goes wrong after we make the modifications we are about to make.
Make the following three modifications to the file's original version using your preferred text editor:
1. Alter the database's name
the line that begins:
The MySQL database name of your previous web host is currently configured in the db_name field of this line. The name of the newly established database must be substituted here.
2. Modify the database user name.
This is followed by the following:
This line has to have the db_user component changed from the old host's username to the newly generated username.
3. Modify your database user password.
Edit the third line last.
Similarly, to the other lines, the db_pass section here needs to be modified to the new safe password you made for your MySQL user.
Close wp-config.php after saving it.
Step 5: Import Your Data Base of WordPress
With a fresh database at your disposal, we can start the import procedure.
Select your new database from the list in the left-hand sidebar of phpMyAdmin once it has been launched from the cPanel program on your new server. Select the Import tab from the navigation menu after it has opened.
Select the SQL file you previously exported by clicking the Choose File button in the File to Import section.
Click the Go button after unchecking the Partial Import checkbox and ensuring that the format is set to SQL. Now the database import will start.
Depending on the size of your database, this import can take a while. When it's done, you ought to get a notification letting you know that the import was successful.
Step 6: Install WordPress on Your New Host.
The wp-config.php file has been updated, and the new database is ready. It is now time to start uploading the files for your website.
Using your FTP program, connect to your new web host and navigate to the folder where your website will be stored. Uploading the files to the public_html folder is standard procedure if this is the sole or major website deployed on the web server.
You can upload your website's files, which should now contain the revised wp-config.php, after choosing the remote directory. Similar to the previous download, this one may take some time.
Once the upload is complete, keep these files on your local computer. They are still required till the last actions are taken.
Step 7: Defining New Domain and Looking Up/Replacing Existing Domain
This step can be skipped if you are not changing to a new or different domain because your website does not need to be updated to point to a new domain.
The fact that they've included links to other posts on their site or directly inserted photos by linking to a URL on the server, which causes things to break when moved over to a new domain, is one problem individuals always seem to have when relocating their site. We recommend taking a look at the Search Replace DB script on Git Hub if you want to quickly and easily search for any instances of your old domain name and replace it with the new name. To host the script, create a temporary folder with an arbitrary name and make sure to DELETE it after you're finished (for security reasons).
Changing the Site URL: By performing a search and replace for the old domain and replacing it with the new domain, you'll also be changing the site_url and home url values in the database. This will make sure that when you try to log into your site on the new domain, it won't attempt to redirect you to the old domain.
Step 8: Finishing Details
This stage actually consists of two smaller steps that could possibly be separated by a few days.
Prior to using the site on your new server, you must first change the DNS settings for your domain. You must change the proper records to point to the new server's IP address because they will already be configured to point to your old host. This process will differ depending on where you registered your domain. Although there are too many specifics to cover in this article, your domain registrar should have all the information you require to make this move.
The entire propagation of DNS updates can take up to 48 hours. When you expect lower traffic volumes, it is better to do this. You should refrain from making any modifications to your website during these 48 hours as you might be altering an older version of the site. Second, once the 48-hour window has passed, visiting your website should now take you to the new web host. You can now connect to your previous web host and remove the files and database. These files, the database export, and the original wp-config.php file should all still be kept locally in case you need to undo the migration. To be on the safe side, it can be a good idea to keep these files around for a while.