In this guide, we show how to manually move an existing WordPress site to a different domain name.
- Step 1 - Verify that your current site is working
- Step 2 - Download the files of your website
- Step 3 - Export your database
- Step 4 - Upload files to your new domain
- Step 5 - Import your database
- Step 6 - Go to wp_options
- Step 7 - Update siteurl and home
- Step 8 - Update connection details in wp-config
- Step 9 - Check your site on your new domain
- Step 10 - Fix permalinks (Optional)
- Step 11 - Fix broken images (Optional)
- Step 12 - Check your site again (Optional)
Step 1 - Verify that your current site is working
Open your current WordPress site and check that everything is working.
Step 2 - Download the files of your website
First, you need to create a backup of your website, both your web space files and your database.
Download the files of your website to your computer and save a copy of the files in a separate folder on your computer to keep as a backup.
Check out one of our guides if you would like some help with this:
Step 3 - Export your database
Export your database with phpMyAdmin and save a copy of the exported sql-file in a separate folder on your computer as a backup.
If you need some help, check out our guide on how to backup your database.
Step 4 - Upload files to your new domain
Log in via FTP and upload your backup to the web space of your new domain. If you made your backup with File Manager, don't forget to unzip it before uploading.
Step 5 - Import your database
Import the backup of your database to phpMyAdmin. Check out our guide on how to import a database, if you would like some help.
Step 6 - Go to wp_options
Once your database has been imported, locate the table called wp_options in the menu to the left.
Step 7 - Update siteurl and home
Next, you need to change the location of your site in the database.
- In wp_options, locate siteurl and home. Usually, these records are at the top of the table on line 1 and 2.
- For siteurl, click the field under option_value and replace the old domain with your new domain name.
- Press enter to save.
- Do the same for home.
Step 8 - Update connection details in wp-config
You now need to replace the login details from your old domain, with those of your new domain in WordPress.
We have created a guide on how to update the connection details in case you need some help.
Step 9 - Check your site on your new domain
Take your old site offline, to make sure it doesn't interfere with your new site. You can do this by moving the files to a different folder.
Open your new domain in your browser and check how it looks. If everything is working as intended you are now done. However often you still need to do some manual fixes.
Step 10 - Fix permalinks (Optional)
If you experience that you get a 404 error when you try to open links on your site, the Permalinks are broken. Luckily it is very easy to fix this.
- Log in to your WordPress dashboard.
- Click Settings and then Permalinks
- Scroll down and click Save Changes.
Step 11 - Fix broken images (Optional)
If you experience that images don't show correctly, this means that the links are still referring to the old domain. You can fix this by reinserting images manually.
When you have a website with a lot of images you can try a plugin called Better Search Replace. It automatically replaces your old domain with your new domain in your database.
Note: Plugins are third party products and not something we can help you with. Please contact the maker of the plugin if you have any problems. We recommend you to make a backup of the files on your website and your database before making any changes.
- Log in to your WordPress dashboard.
- Click Plugins and then Add new.
- Search for Better Search Replace and install the plugin with that name.
- Click Activate to make the plugin active.
- Click Tools and Better Search Replace.
- Search for the old domain name and Replace with the new domain name.
- Select the tables that you want to search in. Your posts are located in the table wp_posts, but usually you can safely select all tables.
- Uncheck the box for Run as dry and click Run Search/Replace. If you want to do a test run before making changes, leave the box for Run as dry checked.
Step 12 - Check your site again (Optional)
In most cases, your website is now successfully moved, including images and links. If you still encounter problems, we recommend you to check the WordPress codex for more help.