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
- 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.
- 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
- 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.).
- 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.
- 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.
- 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.
- Open the
- 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.
- Update permalinks:
- Go to "Settings" > "Permalinks" and click "Save Changes" to update the permalinks.
Additional Tips
- Make sure to update your WordPress site's theme and plugins to ensure compatibility with the new server.
- Test your site thoroughly to ensure everything is working as expected.
- Consider using a backup plugin (e.g., UpdraftPlus) to automate your backups and make the process easier.
By following these steps, you should be able to successfully backup and restore your WordPress site to a new server.