Moving a WordPress website to a new web hosting provider can seem like a daunting task. Many website owners consider changing hosts for various reasons, such as escalating costs, unsatisfactory customer service, or persistent issues like constant website downtime. While the prospect of migration can be intimidating, leading many to postpone the decision, a clear understanding of the process can ensure a smooth transition.

By approaching WordPress hosting migration with proper preparation and knowledge, you can navigate the process with confidence, minimizing potential disruptions and setting your website up for success on its new server.

Expert Assistance or Do-It-Yourself WordPress Migration?

expert or DIY WordPress migration? plesk

To simplify the WordPress migration process, you might consider seeking expert assistance. Many hosting providers offer migration services that can help you seamlessly transition your website. However, migrating a WordPress site independently is entirely feasible, provided you understand the fundamental principles involved.

The key to a successful migration lies in meticulous preparation. By following a structured approach and implementing the correct preparatory steps, moving your website can be straightforward. This careful planning also offers the flexibility to reverse the migration without adverse consequences, allowing you to revert to your previous setup if needed. If you're ready to migrate your WordPress site on your own, here are five essential steps to guide you through the process.

1. Backup and Export Your WordPress Data Before Migration

Backup and export before WordPress migration plesk

Before initiating any website migration, ensuring the ability to revert to your original state is paramount. Therefore, creating a comprehensive backup of your entire WordPress installation is the crucial first step. This backup serves as a safeguard, allowing you to restore your site if any unforeseen issues arise during the transfer to a new server. In addition to your site files, you will also need to export your WordPress database.

Backing Up Your WordPress Instance for Transfer

You can effectively back up your WordPress site files, which include your plugins, themes, core WordPress files, and all uploaded content, using several reliable methods:

  • Utilize dedicated backup plugins available for WordPress, which often provide a user-friendly interface for managing backups.
  • Access your hosting server via SSH, archive all relevant files using commands like tar or zip, and then transfer them to your new host using a secure copy protocol (SCP) connection.
  • Leverage the file management functionalities offered by popular hosting control panels such as Plesk Obsidian or cPanel to archive and download your site files.
  • If your current host uses Plesk Obsidian, consider using the dedicated WordPress management solutions like Plesk WP Toolkit for streamlined backups.
  • Employ an FTP client (e.g., FileZilla, WinSCP, CuteFTP) to connect to your web host and download all files from your host’s machine to your local computer. Remember to configure your FTP client to display hidden files, such as .htaccess, as these are critical. Be aware that downloading a large WordPress instance with numerous media files can be time-consuming, depending on your internet connection and the site's size.

Copying Your WordPress Database

Once your site files are secured, the next essential step is to create a copy of your WordPress database. This can be done concurrently with downloading your site files via FTP. While various methods exist for copying your database, we will focus on the popular and effective phpMyAdmin tool.

Exporting your WordPress database using phpMyAdmin is a straightforward process, though a few considerations are important. First, you need to log into your web server’s hosting control panel (such as Plesk Obsidian or cPanel) and access the phpMyAdmin web interface. On the left sidebar, you will see a list of databases; identify and select the database associated with your WordPress installation. Next, navigate to the Export tab to open the export options page.

phpMyAdmin conveniently offers a default export setting labeled "Quick." Simply click on Quick and then the Go button to initiate the database export process. The database file will then download directly to your PC, ready for import into your new hosting environment.

2. Configure the Database on Your New WordPress Hosting Server

Configure database on new WordPress hosting server plesk

Before uploading your WordPress site files, it is crucial to set up the corresponding database on your new server. To begin, log in to the control panel provided by your new hosting provider. As MySQL is the most widely used database management system, we will use it as our example. If your host utilizes a different database application, you should consult their support team for specific instructions on creating a new database.

Let's outline the process for two common control panels: Plesk Obsidian and cPanel.

  • For Plesk users: Navigate to the "Databases" section and click "Add new database." Provide a suitable name for your database, ensuring that you keep the name's prefix unchanged. Select the website that this new database will be associated with, create a robust user account, assign a strong password, and then submit this information to create the database.
  • For cPanel users: First, open "MySQL Databases" and create a new database with a name that is appropriate for your website. Subsequently, add a new MySQL user and ensure you include a strong, secure password. Finally, it is essential to grant this new user the correct permissions by assigning "All Privileges" rights to the database.

It is vital to carefully record the database password and the database name. These credentials will be indispensable when you configure your WordPress wp-config.php file in the subsequent steps.

3. Modify the WordPress Configuration File (wp-config.php)

Every WordPress installation relies on a critical configuration file, wp-config.php, which contains essential details enabling WordPress to connect to its database. You will find this file within the root folder of the WordPress content you previously backed up and stored on your local machine.

Before making any changes, it is highly recommended to create a separate backup copy of your wp-config.php file and store it in a different folder on your computer. This precaution allows you to easily restore the original file if any errors occur during the modification process. Now, open the original wp-config.php file using a plain text editor and proceed with the following crucial modifications:

Edit the Database Name

Locate the line that defines your database name, which typically appears as:

define('DB_NAME', 'database_name');

You need to replace 'database_name' with the exact name of the new WordPress database you created on your new hosting server. The existing 'database_name' will correspond to your previous database's name.

Add the New Database Username and Password

Updating the database credentials is equally straightforward. For the database username, find the line:

define('DB_USER', 'database_user');

Here, you must update 'database_user' to reflect the username associated with your new database on the new server.

Next, locate the line that defines the database password:

define('DB_PASSWORD', 'database_password');

Similarly, change 'database_password' to your newly created database password. Once you have made these essential changes, save the wp-config.php file and close your text editor.

4. Upload Your WordPress Database and Site Files

Change WP config file for WordPress migration plesk

With your database configured and your wp-config.php file updated, you are now ready to begin importing your WordPress site to your new hosting provider.

Importing the Database

First, launch phpMyAdmin from your new hosting control panel and select the newly created database from the list of options on the left sidebar. Next, navigate to the Import tab located in the navigation bar.

You will now need to import the database file you previously exported from your old host. Click on Choose File in the section labeled "File to Import" and select the .sql file that you saved to your desktop PC. Ensure that the "Partial Import" option is not selected and that the database type is set to SQL. After confirming these settings, click the Go button to start the import process.

Please note that larger databases can take a considerable amount of time to import successfully. You will receive a confirmation message once the database import is complete.

Uploading Your Site Files

After preparing your database and updating your wp-config.php file, the next step is to upload your WordPress site files. Connect your FTP program (e.g., FileZilla) to your new web host using the credentials provided by your hosting provider. Once connected, locate the WordPress files on your local PC that you backed up earlier.

You must then select the correct remote directory on your new server. This is typically the public_html folder or another designated web root directory. If you are unsure, consult your host's documentation or support. After identifying the correct remote directory, you can begin uploading all your WordPress files. This will include the wp-config.php file that you modified with the new database login details. Depending on your internet connection speed and the size of your website, the uploading process may take longer than the initial download. Allocate sufficient time for this to complete before proceeding with the final steps of your WordPress migration.

Transferring Your Domain and Linking to the New URL

WordPress migration often involves moving to a new domain. If this applies to your situation, this step is crucial. However, if you are retaining your existing domain, you can safely skip ahead. Changing your domain can introduce several issues if not managed correctly, particularly regarding internal links and media references.

One common challenge arises when your site contains numerous internal links or references to images that use full, absolute URLs. When your domain changes, these links will break. Fortunately, you can automate the process of searching for and replacing these old links with the new domain. A popular tool for this is Search Replace DB, a script available for download from GitHub. Crucially, after using this tool, ensure you delete it immediately from your server. Leaving it on your server poses a significant security risk. Furthermore, avoid installing this tool in the root directory of your domain. Instead, create a temporary folder with a unique, randomly generated name that is unlikely to be guessed, and install it there.

Updating Your WordPress Site’s Address

The search and replace process outlined above also takes care of updating your site's URL settings. This means that your "Site Address (URL)" and "WordPress Address (URL)" values will be automatically adjusted to reflect your new domain. This ensures that when you attempt to log in to your newly migrated site, you are directed to the correct, updated location rather than the old domain.

5. Finalizing Your WordPress Migration

Finish up your WordPress migration plesk

You are now nearing the completion of your WordPress migration. A few final, yet critical, steps remain, and some of these may require a waiting period of a few days.

Currently, your website's domain is likely still pointing to your old hosting provider. To direct requests to your new host, you need to update your DNS (Domain Name Server) settings. The exact procedure for this varies depending on where your domain is registered and hosted. While comprehensive instructions cannot be provided here due to the vast number of registrars, your domain registrar will be able to assist you with updating the nameservers or A records to point to your new hosting server.

It is important to note that it can take some time—typically up to 48 hours—for changes to domain details to propagate fully across the internet. This process, known as domain propagation, is unavoidable. During this propagation period, you must refrain from making any changes to your site. Modifying your site during this time could result in changes being applied to your original website hosted on the old server, rather than your new site instance. After the 48-hour propagation period, it should be safe to make modifications and to delete the content of your old site from your previous hosting provider. Always retain your backup files on your local PC and keep your old wp-config.php file as a reference, just in case you ever need it.

While the process of WordPress site migration might seem intricate, it is not overly complicated when approached methodically. Exercising caution at every step is essential to ensure a smooth transition. Always maintain a complete backup of your original site on your computer, providing a reliable fallback option should any issues arise.

Was this answer helpful? 0 Users Found This Useful (0 Votes)