Migrating your WordPress site to a new host can be necessary for various reasons, such as better performance, more features, or improved customer support. The process involves transferring all your site’s files, databases, and settings to the new hosting provider without losing any data or functionality. While this might seem complex, with careful planning and execution, you can smoothly move your site to a new host with minimal downtime.
There are several methods to migrate a WordPress site, including using a migration plugin, manually transferring files and databases, or utilizing your new host’s migration service. This guide focuses on the manual method, which gives you complete control over the migration process. This method is ideal if you want to avoid relying on plugins or if your site is large and complex.
Following the steps below will help you successfully migrate your WordPress site to a new host. By carefully following each step, you can ensure that your site is fully functional and accessible on the new host without any issues.
Steps to migrate your WordPress site to a new host:
- Backup your WordPress site files and database.
Backing up your site ensures that you have a complete copy of all your files and databases in case something goes wrong during the migration.
$ zip -r wordpress-backup.zip /path-to-your-wordpress-files/ $ mysqldump -u your-username -p your-database-name > database-backup.sql
- Download the backup files to your local computer.
Use an FTP client or your hosting provider's file manager to download the WordPress files and database backup.
- Upload the backup files to your new host.
Use an FTP client or your new host's file manager to upload the WordPress files to the public_html directory (or appropriate directory) of your new hosting account.
- Create a new database on the new host.
Log in to your new hosting provider's control panel and create a new MySQL database and user. Note down the database name, username, and password.
CREATE DATABASE new_database_name; CREATE USER 'new_username'@'localhost' IDENTIFIED BY 'new_password'; GRANT ALL PRIVILEGES ON new_database_name.* TO 'new_username'@'localhost'; FLUSH PRIVILEGES;
- Import the database backup into the new database.
Use phpMyAdmin or the MySQL command line to import the database backup into the new database.
$ mysql -u new_username -p new_database_name < database-backup.sql
- Update the wp-config.php file with the new database details.
Edit the wp-config.php file in your WordPress directory to reflect the new database name, username, and password.
define('DB_NAME', 'new_database_name'); define('DB_USER', 'new_username'); define('DB_PASSWORD', 'new_password'); define('DB_HOST', 'localhost');
- Update your domain's DNS settings to point to the new host.
Log in to your domain registrar's control panel and update the nameservers or A record to point to your new hosting provider.
DNS changes can take up to 48 hours to propagate worldwide, during which your site might be accessible from both old and new hosts.
- Test your site on the new host.
Once the DNS has propagated, visit your site using your domain name to ensure that everything is working correctly on the new host.
- Check for broken links and missing content.
Ensure all pages, posts, images, and links are functioning as expected after the migration.
- Update any hardcoded URLs if necessary.
Use a search-and-replace tool in your database to update any old URLs that might still be pointing to the previous host.
- Delete the backup files from the old host.
Once the migration is confirmed to be successful, remove the backup files and data from your old hosting account to avoid any security risks.

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.