Shift Wordpress to a new Server
Migrating a WordPress site to a new server can seem like a daunting task, but with careful planning and execution, it can be accomplished smoothly. This guide provides a step-by-step approach to ensure that your website transition is as seamless as possible. Whether you’re upgrading to a more powerful server, changing hosting providers, or moving to a new domain, this document covers the essential steps for a successful migration.
1. Backup Your WordPress Site
- Backup Files: Use an FTP client (like FileZilla) to download all your WordPress files from the old server.
- Backup Database: Access your old server’s phpMyAdmin and export the WordPress database as an SQL file.
2. Prepare the New Server
- Set Up the Server: Ensure your new server has PHP, MySQL, and Apache/Nginx installed and configured.
- Create a Database: In the new server’s phpMyAdmin, create a new database for your WordPress site.
3. Upload Your Files
- Upload Files: Use an FTP client to upload all your WordPress files to the new server.
- Update
wp-config.php
: Modify thewp-config.php
file with the new database details:define('DB_NAME', 'new_database_name'); define('DB_USER', 'new_database_user'); define('DB_PASSWORD', 'new_database_password'); define('DB_HOST', 'localhost'); // Or the appropriate host
4. Import the Database
- Import SQL File: In the new server’s phpMyAdmin, select the new database and import the SQL file you exported earlier.
5. Update URLs
- Update Site URL: Access the database through phpMyAdmin, go to the
wp_options
table, and update thesiteurl
andhome
values to reflect the new domain or URL. - Search and Replace: Use a plugin like “Better Search Replace” or manually run SQL queries to update any old URLs in the database.
6. Test Your Site
- Check Functionality: Verify that all parts of your WordPress site are functioning correctly on the new server.
- Update Permalinks: Go to Settings > Permalinks in the WordPress admin panel and re-save the permalinks structure to ensure everything is linked correctly.
7. Update DNS
- Change DNS Records: Update your domain’s DNS records to point to the new server’s IP address. This might be done through your domain registrar’s control panel.
8. Final Check
- Verify Site: Make sure the site is fully functional and all links are working as expected.
Note: Some themes and plugins may need reactivation or additional configuration on the new server.