The ability to copy a WordPress site is really useful for several reasons, especially if you’re considering a redesign or for testing purposes. Having a copy of a “starter” WordPress site also comes in handy if you deploy new websites for clients with the same settings, plugins and themes installed. In this post, we’ll cover how to copy a WordPress site in just a few steps.

copy wordpress site

Getting Started: The Components of a WordPress Website

A WordPress website is made up of two basic components. Both will need to be included to have a complete copy of your website:

  • The WordPress database. The WordPress database contains the content (text) of your WordPress posts, pages, comments, and users.
  • The files that make your WordPress website function. Your WordPress website contains hundreds of files that work together to make your website operate. These files include the core WordPress files, all the files you’ve uploaded to your media library (.jpg, .png, etc.), Javascripts, PHP scripts, and other code files, plus all your theme or plugin files. Additionally, you must copy all of your files in your WordPress directory (including subdirectories) and your .htaccess file. These files are not stored in your WordPress database.

Making a Copy is Like Making a Backup

Copying your WordPress website is very similar to making a backup.

A WordPress backup essentially makes a copy of your entire WordPress installation (including your WordPress database and all files in your WordPress installation). And just like making a backup, you’ll 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 copying a WordPress site manually. If you aren’t comfortable with editing code or browsing files on your server, you can skip ahead.

Copying 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 alredy 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.

phpmyadmin export database

Your database file should download automatically in an .sql format. Depending on the database size, this may take a few seconds.

Copying Your Site’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.

wordpress files ftp

Using BackupBuddy to Copy a WordPress Site

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.

  • You can copy your WordPress site directly from your WordPress dashboard (no need to login to cPanel or and FTP client).
  • Your entire WordPress website (including your database and files) can be downloaded into one zip file in a matter of minutes.
  • You can easily move the copied site to a new location such as a different domain, host or testing server with BackupBuddy’s ImportBuddy script.
  • 1. To get started, install and activate the BackupBuddy plugin on your WordPress website.
  • 2. 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.

complete wordpress backup

  • 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.

download wordpress backup file

Moving Your WordPress Site Copy to A Different Domain, Host or Testing Server

Once you have a copy of your WordPress site, you’ll most likely want to use it for a testing environment or for development. To do this, you’ll need to move your WordPress site copy to a different directory on your server, to a new domain or to a localhost.

Manually Moving Your 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.

Using BackupBuddy To Move Your WordPress Site in 10 Steps

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 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
  • 1. Download your complete backup file and leave it in the zip format (see step 1 – 4 above).
  • 2. Navigate to the Restore/Migrate page in the BackupBuddy menu. Click the button to download the ImportBuddy script.

download importbuddy

  • 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.

importbuddy password

  • 4. The next part of the process requires you to create a 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:
    A Step by Step Guide for How to Move a WordPress Site to a New Domain with BackupBuddy

create new wordpress database

  • 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.

empty wordpress directory

  • 6. Open the directory (folder) of the final location of the WordPress site. Note: Most hosting providers will automatically set up and name the directory when you add the domain name to your hosting account. Your directories will be located in the /public_html directory. IMPORTANT: This directory will need to be empty prior to uploading the backup zip file and the importbuddy.php file. If there are existing files in this directory, go ahead and delete them so you have an empty folder.

upload files to cpanel

  • 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:

backupbuddy upload to directory

  • 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.

importbuddy step 6

  • 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

The post How to Copy a WordPress Site appeared first on iThemes.

Powered by WPeMatico