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

  1. Backup Files: Use an FTP client (like FileZilla) to download all your WordPress files from the old server.
  2. Backup Database: Access your old server’s phpMyAdmin and export the WordPress database as an SQL file.

2. Prepare the New Server

  1. Set Up the Server: Ensure your new server has PHP, MySQL, and Apache/Nginx installed and configured.
  2. Create a Database: In the new server’s phpMyAdmin, create a new database for your WordPress site.

3. Upload Your Files

  1. Upload Files: Use an FTP client to upload all your WordPress files to the new server.
  2. Update wp-config.php: Modify the wp-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

  1. Import SQL File: In the new server’s phpMyAdmin, select the new database and import the SQL file you exported earlier.

5. Update URLs

  1. Update Site URL: Access the database through phpMyAdmin, go to the wp_options table, and update the siteurl and home values to reflect the new domain or URL.
  2. 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

  1. Check Functionality: Verify that all parts of your WordPress site are functioning correctly on the new server.
  2. 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

  1. 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

  1. 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.