The ability to copy a WordPress site is really useful for several reasons, especially if you’re considering a website redesign or for testing purposes (like trying a new theme). Having a copy of a WordPress site also comes in handy if you deploy new websites for clients with similar settings, plugins, and themes installed. You may also want a copy of a WordPress website if you’re wanting to learn how it was built.
In this post, we’ll cover how to copy a WordPress site in just a few steps. We’ll cover both the manual method of copying a WordPress site as well as how to shortcut the process with a plugin like BackupBuddy.
Getting Started: The Components of a WordPress Website
A WordPress website is made up of two basic components. Both components will need to be included to have a copy of your website:
- 1. The WordPress database. The WordPress database contains the content of your WordPress posts, pages, comments, and users and more.
- 2. The files that make a WordPress website function. A WordPress website contains hundreds of files that work together to make your website operate. These files include the WordPress core files, all the files you’ve uploaded to your media library (.jpg, .png, etc.), PHP scripts, and other code files, plus all your theme or plugin files. Additionally, you must copy all files in your WordPress installation directory (including subdirectories) and your .htaccess file. (These files are not stored in your WordPress database.)
Making a Copy of Your WordPress Website is Just Like Making a Backup
In reality, copying your WordPress website is very similar to making a backup of your website. A WordPress backup essentially makes a copy of your entire WordPress installation (including your WordPress database and all files in your WordPress installation). Just like making a backup, you’ll also need an easy way to access your backup files in a downloadable format.
How to Copy a WordPress Site: The Manual Method
In this section, we’ll cover the manual method for how to copy a WordPress site. If you aren’t comfortable with editing code or browsing files on your server, you can skip ahead.
How to Copy Your Site’s Database
- 1. To copy your site’s database, you’ll need access to phpMyAdmin on your site’s server. As a quick reference, you’ll find the phpMyAdmin icon located after logging in to cPanel.
- 2. Click on the phpMyAdmin icon and login. (If you’re already logged into cPanel, phpMyadmin should launch automatically.)
- 3. From left side of the page, select your WordPress database. In this example, the name of database is “wp”.
- 4. You should now see all the tables included in your WordPress database (for example: wp_commentmeta, wp_comments, wp_options, wp_posts, etc.)
- 5. Click the ‘Export’ tab on the top set of tabs. Select the “Quick” option, and the click the Go button.
Your database file should download automatically in an .sql format. Depending on the database size, this may take a few seconds.
How to Copy Your Website’s Files
You can use an FTP client to manually copy the files on your server to a folder on your computer. Once you’ve downloaded the files, you can zip or compress them into a zip file. Note: depending on the size of your site, this download could take a while.
How to Copy a WordPress Site with a Plugin (The Easy Way)
The WordPress backup plugin, BackupBuddy, makes copying WordPress sites much easier than the manual method. With BackupBuddy, there’s no need to manually export or download any files.
Here are a few ways BackupBuddy makes copying a WordPress site easier:
- You can copy your WordPress site directly from the WordPress admin dashboard (no need to login to cPanel or an FTP client).
- Your can download an entire WordPress website in a zip file (including your database and files) in a matter of minutes (sometimes seconds).
- You can quickly move the website copy to a new location such as a different domain, host or testing server with BackupBuddy’s ImportBuddy script.
Use the BackupBuddy Plugin to Make a Complete Backup
- 1. To get started, install and activate the BackupBuddy plugin on your WordPress website. You can buy BackupBuddy here and then download the plugin zip file from the iThemes Member Panel.
- 2. Once you’ve activated the BackupBuddy plugin, expand the BackupBuddy menu on the left side of your WordPress dashboard and click the ‘Backup’ link.
- 3. On the Backup page, click the Complete Backup button to start running a backup of your site’s files and database.
- 4. Once the backup has completed, you can download your backup file as a zip file to your computer. This backup file is essentially a complete copy of your WordPress site.
- 4. Once you’ve downloaded the backup zip file, you can expand it to see the contents. This is the copy of your website.
How to Move the WordPress Site Copy to A Different Domain, Host, or Server
Once you have a copy of a WordPress site, you’ll likely want to use it for a testing environment or for development purposes. To do this, you need to move your WordPress site copy to a different location, such as a different directory on your server, to a new domain, or to a localhost.
The Manual Method of Moving a WordPress Site
If you’re interested in manually moving your website copy, use these two posts as a reference. These posts include more in-depth instructions if you want to tackle doing it manually.
- From the WordPress Codex: Moving WordPress
- From the WordPress Codex: Restoring Your Database From Backup
How to Use BackupBuddy To Move Your WordPress Site
BackupBuddy makes the process of moving a WordPress website easy by automating the process.
For example, BackupBuddy removes these complicated steps from the process:
- Editing the wp-config.php file with the new server’s MySQL database name, user and password.
- Searching and replacing on your entire database to change URLs
- Changing uploaded media to refer to the new location
- Migrating serialized data
We have two more in-depth tutorials, but the process works like this. You can read both scenarios here.
Moving a WordPress Website to a New Server or Web Host
How to Move a WordPress Site to a New Server
In this post, we cover a step-by-step guide for how to move a WordPress site or blog to a different server or hosting company. Read more …
You’ll want to use this tutorial if you need to move your website copy to a different server or directory on your current hosting plan. You’ll also want to use this tutorial if you are transferring the website copy to a new hosting company.
Moving a WordPress Website to a New URL or Domain Name
How to Move a WordPress Website to a New Domain
In this post, we cover a step-by-step guide for how to move a WordPress site to a new URL or domain. Read more …
Use this tutorial if you only need to change the domain name or URL of the website copy. (You can also tweak the server or hosting location using this method.)
Instructions for How to Move a WordPress Website with BackupBuddy
1. Download your complete backup file and leave it in the zip format (see steps 1 – 4 above in the “Getting Started with BackupBuddy” section). Note: Don’t unzip the backup file.
2. Navigate to the Restore/Migrate page in the BackupBuddy menu. Click the button to download the ImportBuddy script.
3. Confirm your ImportBuddy password. In the window that pops up, enter a new password or leave blank to use the ImportBuddy password you set up when you first installed BackupBuddy. This password is important because it locks the ImportBuddy script from unauthorized access. Click OK and the download will begin.
4. The next part of the process requires you to create a WordPress database on your server for your copied WordPress site. BackupBuddy will handle taking the database from your copy and replacing the tables, but you still need a new, blank database.
Be sure to copy the database name, username and password you create in this section to use during the ImportBuddy migration process later.For step-by-step instructions on how to create a new MqSQL database, see this post
5. Next, upload the backup zip file and the ImportBuddy file into the directory of the new/moved site on your server. (Basically, a directory is where your WordPress site “lives” on your server. All the files that run the WordPress site are located within this folder (directory).) For this step, you can use FTP access to the server or the File Manager within your cPanel. You just need to have access to upload (or delete) files on your server.
6. Open the directory (folder) of the final location of the WordPress site.
7. Upload the importbuddy.php file and the backup zip file to this empty directory. You can use the Upload function within the File Manager here. 14. After you upload the importbuddy.php file and the backup zip file, the directory should look like this:
8. This final series of steps will guide you through using ImportBuddy to finish up the site move. Navigate to the site URL/importbuddy.php. For our example site move, we’d visit this link in your browser.
9. Follow the remaining ImportBuddy steps to complete the site move. Input your new database credentials on step 3. On the last step, verify the site is working by clicking on the site URL.
10. Click the “Finish Cleanup” button. That’s it! You’ve successfully moved your WordPress site copy to a new location.
Get BackupBuddy Now
Get BackupBuddy, the 3-in-1 WordPress backup plugin. Easily backup, restore and migrate your WordPress site with BackupBuddy.
Get BackupBuddy now
Each week, the team at iThemes team publishes new WordPress tutorials and resources, including the Weekly WordPress Vulnerability Report. Since 2008, iThemes has been dedicated to helping you build, maintain, and secure WordPress sites for yourself or for clients. Our mission? Make People’s Lives Awesome.