Backup and restore wordpress site to new server

Here's a step-by-step guide on how to backup and restore a WordPress site to a new server:

Backup

  1. Backup your database:
    • Log in to your current server's control panel (e.g., cPanel) and navigate to the "Databases" section.
    • Click on "phpMyAdmin" and select the database associated with your WordPress site.
    • Click on the "Export" tab and select "Quick" as the export method.
    • Choose "SQL" as the format and click "Go".
    • Save the SQL file to your local machine.
  2. Backup your files:
    • Use an FTP client (e.g., FileZilla) to connect to your current server.
    • Navigate to the root directory of your WordPress site and select all files and folders.
    • Right-click and select "Download" or "Get" to download the files to your local machine.
    • Alternatively, you can use the "Backup" feature in your control panel (e.g., cPanel) to create a zip file of your files.

Restore

  1. Upload files to new server:
    • Use an FTP client (e.g., FileZilla) to connect to your new server.
    • Navigate to the root directory of your WordPress site and upload the files you downloaded earlier.
    • Make sure to upload the files in the correct directory structure (e.g., wp-content, wp-includes, etc.).
  2. Create a new database on new server:
    • Log in to your new server's control panel (e.g., cPanel) and navigate to the "Databases" section.
    • Click on "MySQL Databases" and create a new database.
    • Note down the database name, username, and password.
  3. Import database to new server:
    • Log in to phpMyAdmin on your new server and select the database you created earlier.
    • Click on the "Import" tab and select the SQL file you exported earlier.
    • Click "Go" to import the database.
  4. Update wp-config.php file:
    • Open the wp-config.php file in a text editor and update the database settings to match your new server's database credentials.
    • Save the file.
  5. Update site URL:
    • Log in to your WordPress site's dashboard and go to "Settings" > "General".
    • Update the "WordPress Address" and "Site Address" fields to reflect the new server's URL.
    • Save the changes.
  6. Update permalinks:
    • Go to "Settings" > "Permalinks" and click "Save Changes" to update the permalinks.

Additional Tips

By following these steps, you should be able to successfully backup and restore your WordPress site to a new server.