How to Clone Your Website

It seems that we get this question on a weekly basis: “I want to copy my website to a new domain or different folder, but I’m not sure of the best way to do this. How is it done?”

Manual Cloning

It used to be that the best way to do this was to simply download all the files to your computer via FTP, then remove them from the server and upload them to the new location. With the common use of databases now, this doesn’t entirely take care of the problem; in many cases entries in the database reference the old domain, making it a long and messy process to complete. It looks like this:

  1. Download your files
  2. Edit your configuration file to reference the new domain and path
  3. Upload the files to the new location
  4. Export your database
  5. Edit the database by finding all references to the old domain/path and replace them with the new ones
  6. Import the database again

Lengthy, cumbersome and often technical; this is not an easy approach. But don’t worry! It turns out there is an easier way. Just be sure that you’re using one of the apps in our web application installer (e.g.: WordPress, Joomla, ImpressPages, and dozens more!)

Cloning with 1-click web apps

  1. Add your new domain in Plesk
  2. Go to the 1-click web apps utility and find the web app in the list that runs your site
  3. Press the Clone button and select the new domain and/or path
  4. Click Clone or Continue to proceed with the clone.

That’s it! It will automatically update all configuration files and paths in the database for you as well as copy over all files. The only exception to this rule is any paths / files that you may have custom created outside of the application itself. Be sure to copy those over manually after the clone is complete.

If you then wish to point the old domain to the new one, take a look over our guide to setting up a 301 redirect or, once you’re happy with the new domain, remove the old one in Plesk, then add it as a domain alias to the new domain.

Troubleshooting

After cloning my site, styles and theme settings are not loading properly!

This is, unfortunately, a common one. It might make you think that the clone is not actually a perfect copy, well you’d be somewhat right! But it’s not actually the clone process to blame (per se).

Many themes store their data in a format called serialization. You can read more about this here. Basically, when serialization is used, every string of text is saved to the WordPress database with both the text and an associated # of characters.

When our clone tool migrates the data, it updates all instances of the old domain with the new one. The only problem is, it doesn’t know how to update the associated character count. When your theme goes to load its content, it gets really pissed off that the character count doesn’t match the actual text and gives up.

Well built themes either don’t use serialized data or they provide one of two solutions to this problem:

  1. When you manually re-save your theme settings (note, not WordPress settings — the settings fields that pertain only to the theme), it will detect the original data and create new character counts to match, thus fixing everything with a simple click of the save button!
  2. Others aren’t so elegant, and instead they’ll require you to export your data from the old domain/installation to some random format of their choice (xml? csv?) then import that file into the new installation. This requires more work (boo), but it does solve the problem.

If you’ve run into this problem and your theme does not support one of the above two solutions (or even if they only support the 2nd one), we suggest either reporting the issue to your theme developer, or consider switching themes.

Jordan is a computer, security, and network systems expert and a lover of all things web and tech. Jordan consults with project management for software companies. Jordan is a founder and managing partner at Websavers Inc.