You may need to copy or move your website to a new location, either because you have a new URL or you want a copy of your site to work on for your redesign. This article provides two methods for this process. A video follows the instructions in case you’d like a detailed demonstration of each method. Skip to the video →
Note: If you’re copying your site with the intent to redesign it, migrating to a subdomain on your site makes migrating back easier.
Both methods will move your Headway design because both methods transfer the database. However, we recommend using method 1 to do this.
Option 1: Move Your Site with Backup Buddy
Part 1: Back Up the Live Site
You need to take a copy of the first site to copy over to the second site.
- Purchase and install BackupBuddy.
- Make sure BackupBuddy is configured to back up non-WordPress tables.
- In the WordPress admin panel, perform a full backup of your site.
- Download the backup .zip file (click the name of the backup in the list of available backups, and it downloads to your local computer).
- Use the link provided in the BackupBuddy settings to download importbuddy.php.
Part 2: Prep the New Site
Before you restore your copy using BackupBuddy, you’ll need to make sure your second site is ready to receive the backup. Details can vary from web host to web host, so these are general steps.
- In your host’s cPanel or other control panel, add a new domain. If you’re creating a development site, this can be a a subdomain (such as dev.yoursite.com) or a subfolder (yoursite.com/dev). We recommend a subdomain; it means that relative URLs don’t break when you migrate your design.
- In your host’s control panel, add a new database. Make sure to note the name of the database, and ensure there’s a user assigned to the database with full privileges. You should also know the username and password of the user. Most web hosts use “localhost” to connect to the database, but some hosts (like Dreamhost) have special hostnames set up, like mysql.yourdomain.com. If you aren’t sure what the username is, contact your web host.
- Move the .zip file and importbuddy.php via FTP to the web root folder on your new site.
- Go to http://yoursite.com/importbuddy.php, and run through the wizard. If you run into a problem, iThemes has documentation and forums to help.
Option 2: Move Your Site Manually
If you don’t want to buy BackupBuddy, follow these steps to copy your site manually.
- Take a full backup of your site via FTP by downloading everything in the directory that contains your wp-admin folder to your computer.
- Upload the files you just downloaded to the appropriate folder on your server (usually something like yourdomain.com/public_html or yourdomain.com/web/content).
- Take a backup of your database. You can use a plugin like WP-DB-Backup. Make sure you select all the additional tables when you create the backup (see the options at the top).
- In your web host’s control panel, add a new database. Make sure to note the name of the database, and ensure there’s a user assigned to the database with full privileges. You should also know the username and password of the user. Most web hosts use “localhost” to connect to the database, but some hosts (like Dreamhost) have special hostnames set up, like mysql.yourdomain.com. If you aren’t sure what the username is, contact your web host.
- Import the original database’s data:
- Go into phpMyAdmin (database management) in your host’s control panel.
- Click the new database on the left.
- Click the Import tab. Upload the file you created and downloaded when you took your database backup, and click Go. A success message appears with the number of queries run.
- Edit wp-config.php on your server. Change the lines near the top that have the database name, username, password.
- Finally, follow these instructions to change the site URL. The first option, editing wp-config.php, is what you need. You can place that code right before the //.
- You also need to do a search and replace on the database but you need to use a method that protects the serialization in the database. We recommend using Interonnectit’s Search & Replace but make sure you use the stable version. Additionally, the plugin Better Search and Replace works well, the last time we tested it..