Migrating a New WordPress Site
Migrating a new WordPress website to an old domain involves a few key steps. Here’s a straightforward process:
- Backup Your Websites:
- New Website: Backup the files and database of your new WordPress site. You can use plugins like UpdraftPlus or manually export the database and copy the files.
- Old Website: Backup the old website as well, just in case you need to revert any changes.
- Update DNS Settings:
- If you’re moving to a different hosting provider, update the DNS settings to point to the new server’s IP address.
- Transfer Files:
- New Site Files: Copy all files from your new site’s directory to the old domain’s directory. You can use an FTP client or a file manager provided by your hosting provider.
- Export and Import Database:
- Export New Database: Use phpMyAdmin or a similar tool to export the new site’s database.
- Create New Database: On the old domain’s server, create a new database or use an existing one if it’s empty.
- Import Database: Import the exported database from the new site into the old site’s database.
- Update
wp-config.php
:- Edit the
wp-config.php
file on the old domain’s server to reflect the new database name, user, and password.
- Edit the
- Update Site URLs:
- Database: Use phpMyAdmin or a similar tool to update the site URL in the database. Search for and replace old domain URLs with the new domain URL in the
wp_options
table (fieldssiteurl
andhome
). - Search and Replace: Use a plugin like Better Search Replace to update URLs in the content.
- Database: Use phpMyAdmin or a similar tool to update the site URL in the database. Search for and replace old domain URLs with the new domain URL in the
- Update Permalinks:
- Log in to the WordPress dashboard on the old domain and go to Settings > Permalinks. Click Save Changes to refresh the permalinks.
- Check and Update Paths:
- Ensure all paths in your themes and plugins are updated if they include absolute URLs pointing to the new domain.
- Test the Site:
- Thoroughly test the site to ensure everything is working correctly. Check for broken links, missing images, and functionality.
- Clean Up:
- Delete the old site files if they are no longer needed and clear any caches.