Copy wordpress file and data to a new site

A common task!

To copy a WordPress site from one location to another, you'll need to transfer both the files and the database. Here's a step-by-step guide to help you do so:

Step 1: Backup the old site

  1. Log in to your old WordPress site's dashboard.
  2. Go to Tools > Export and download the WordPress export file (.xml or .sql).
  3. Download the site's files using an FTP client (e.g., FileZilla) or the built-in WordPress file manager (if your host allows it).

Step 2: Prepare the new site

  1. Set up a new WordPress installation on the new site.
  2. Install the same theme and plugins as the old site (if applicable).
  3. Create a new database for the new site (if not already done).

Step 3: Transfer files

  1. Use an FTP client (e.g., FileZilla) to connect to the new site's server.
  2. Upload the backed-up files from the old site to the new site's root directory (e.g., public_html or www).
  3. Make sure to overwrite any existing files on the new site.

Step 4: Transfer database

  1. Use a database management tool (e.g., phpMyAdmin) to export the old site's database.
  2. Import the exported database into the new site's database.

Step 5: Update site URLs

  1. Log in to the new site's dashboard.
  2. Go to Settings > General and update the WordPress Address and Site Address fields to the new site's URL.
  3. Update any hardcoded URLs in the theme and plugins (if necessary).

Step 6: Update permalinks

  1. Go to Settings > Permalinks and click Save Changes to update the permalinks.

Step 7: Test the site

  1. Visit the new site to ensure everything is working as expected.
  2. Check for any broken links or images and update them accordingly.

Additional tips:

By following these steps, you should be able to successfully copy your WordPress site from one location to another.