Moving a WordPress site involves three parts: copying the files, copying the database, and updating the site's URLs and DNS to point at the new host. Missing the database or URL step is the most common reason a migrated site loads broken or shows the old host's content.
Step 1: Back Up the Current Site
- Download a full copy of your WordPress files (the wp-content folder at minimum, ideally the whole site directory) via FTP or your current host's File Manager.
- Export the database: in phpMyAdmin, select your WordPress database and use Export with the default settings to download an .sql file.
Keep both files somewhere safe until the migration is confirmed working, don't delete anything from the old host yet.
Step 2: Set Up the New Host
- Create a new MySQL database and database user on the new hosting account, and note the database name, username, and password.
- Upload your WordPress files to the new account's document root via FTP or File Manager.
- Import the .sql file into the new database through phpMyAdmin on the new host.
Step 3: Update wp-config.php
Open wp-config.php in the uploaded files and update these lines to match the new database:
define('DB_NAME', 'new_database_name');
define('DB_USER', 'new_database_user');
define('DB_PASSWORD', 'new_password');
define('DB_HOST', 'localhost');
DB_HOST is usually localhost on shared hosting, but check with your new host if you're unsure.
Step 4: Fix URLs If the Domain Changed
WordPress stores your site's URL inside the database itself, not just in configuration files. If you're also changing domains, or moving from a temporary hosting URL to your real domain, you need to search and replace the old URL with the new one across the database, not just in wp-config.php. A search-replace plugin, or a manual query in phpMyAdmin, handles this.
If the domain isn't changing, skip this step. Only the hosting account is moving, so the URLs already stored in the database are still correct.
Step 5: Test Before Switching DNS
Before pointing your domain at the new host, test the migrated site using a temporary URL or by editing your local computer's hosts file to preview it. Check that pages load, images display, and forms work.
Step 6: Point the Domain to the New Host
Once you've confirmed the new site works, update your domain's nameservers or DNS records to point to the new hosting. This is a separate step from the migration itself and can take a few hours to fully propagate.
Keep the old hosting account active for a few days after switching DNS. Some visitors and search engine crawlers may still reach the old server until propagation completes everywhere.