Migrating a WordPress website can be a complex task, but with the right tools and knowledge, it is a process that can be done without problems. This article will explore different ways to migrate a WordPress site to another server or domain. We will learn about best practices and tools available to facilitate this process.
Things to keep in mind before doing a migration
When facing a hosting/WordPress provider migration, you must be clear about what needs to be migrated, namely:
- Files: This is what makes your CMS (WordPress/Prestashop) work correctly. Transferring all the files to avoid possible incidents in the new hosting is essential. Typically, it is downloaded via SSH (hosting is in charge in 99% of cases) or with a script that connects the different panels (cpanel-cpanel / cpanel-plesk).
- Databases: Just as important as files. There are not always databases (in the case of flat HTML websites), but in 98% of cases, there are. And they must be migrated, respecting, of course, the users of these databases and their passwords.
- Email: If you do not have a service dedicated to this topic (such as Google Workspace), email is usually managed within your hosting provider. In this case, most hosting uses the cPanel panel, which saves the emails as files, so although this part usually goes under” Files “, you have to be clear about how the client has it set up to know how to proceed with this section.
In most hosting, if you contract an annual plan with them, they migrate you for free; in any case, confirming it with the new hosting before contracting is good. We recommend sending them a ticket/email telling them the total size your website occupies (or rather, the entire space you occupy in the hosting) and the server panel you have (cPanel/Plesk are the most used).
Ways to migrate a WordPress
If you have to migrate your website, there are several ways to migrate your WordPress website to your new hosting. Let’s see what they are:
Manual migration via zip
The first option is to compress all the files on your current hosting and export them to the new one. In this case, we will make the guide for the cPanel panel, which is the most used.
- We will enter the file manager, which is still like FTP access from a web page (not precisely, but for practical purposes, it is the same).
- Next, we go to the root folder of our web page. Usually, it will be public_html.
- We select all the files and click to compress.
- We select zip format and compress the files.
This process generates a .zip file with all our files on the old hosting, but we still have to remove the database. To do this, we have to go to phpmyadmin.
- We access phpMyAdmin from cpanel.
- We select the database where our WordPress is hosted (we pixelate the actual name of our databases for security).
- We go to the Export section, leave the Quick option (no need to customize) and click Export.
It will generate a .sql format file containing what is necessary to create the tables and insert all the data into the future new database.
Migration via All-in-One Import
As an “alternative” (be careful, we put it in quotes because although it can also be done, we must be clear about the peculiarities of this method), we can also use the All-in-One Migration plugin, which you can download from here: Link.
This program works so that it makes a backup copy of all the “non-common” elements between WordPress. To explain a little better:
WordPress, in terms of files, is made up of three main folders:
- Wp-admin: All the files that make your administration panel (back office) work.
- Wp-content: All the files that “the user uploads”, including the theme, plugins, images, etc. This is the important one that we want to “migrate.”
- Wp-includes: All files that include WordPress functionalities.
Both wp-admin and wp-includes are familiar to all WordPress, as long as they are the same version. The only thing that changes are two things: the database and the wp-content folder. Knowing that the plugin we mentioned only makes a copy of these two things, you must be careful about installing the same version of WordPress that you had before on the new hosting.
Follow this recommendation and install a new version of WordPress to avoid problems and incompatibilities with some themes/plugins.
Let’s get down to business:
- Once the plugin is installed, we go to Export.
- We leave the advanced options without touching anything and directly click Export to -> File.
- The process may take a few minutes, depending on the files’ size and the database. It generates a file with its .wpress extension that contains, as we have said, files and a database. Once it has finished, it will ask you to save the file. Now, it would be:
- Install a WordPress on the new hosting.
- Install the All-in-one Migration plugin again on the latest WordPress.
- Import the .wpress file.
Once the process is finished, you can enter the administration panel with the old accesses. We strongly recommend that you regenerate the .htaccess file. The easiest way is to change the Permalinks settings. Remember to leave the settings you had. This is done so WordPress restores the file and leaves it as default.
Migration via hosting
As we have mentioned before, in most hosting, they give you the migration for free, although it depends on the amount of the hosting. They commonly provide a “minimum” to qualify for that free migration. If your hosting takes care of this, you must provide them with the following information:
- Access to cPanel: So they can migrate files/databases.
- List of emails and passwords: It depends on where you have the emails managed. They need the users and emails to replicate them in the new hosting and migrate the emails. This step is optional if you use an external email service like Google Workspace.
Remember that you would also have to manage the domain transfer, which, although it is not mandatory, it is common for the domain to be registered at the same registrar where you have the hosting. For .com domains, the auth code is required to request this transfer.