Would you like to save a webpage to your computer? Whether you want to download a full website for archive purposes or simply want to use a webpage to replicate as a template for your own website, it’s easier than you might think to copy or clone a websites! Another important purpose of cloning or migrating a website is to move the site to ‘Live’ or to create a staging environment for testing. We have mentioned all the aspects of cloning a website as well as after cloning/migrating the website.
Pre-Checks to Clone a Website
Before you clone a website, there are some things that you need to check:
Before you move to a new server, make sure the version of PHP/MySQL used on the new server is either the same or up to the recommended versions of WordPress. (https://wordpress.org/about/requirements/)
We recommend having the same configuration as your old host to avoid misfires of any features’ malfunction.
Setting up PHP Values
Most of the managed WordPress hosts like Nestify are preconfigured for optimized output, but if you are migrating to shared hosting, make sure you update the PHP configuration for the following:
This is the time limit for execution of your scripts, where the default is set to 30 sec. This time limit is enough for many sites, but if you are running heavy data like eCommerce, you will need more time for processing.
This is the memory allocation on the server for the execution of the scripts. The more memory allocation, the better it is.
This is the size of data that can be shared over scripts. Say you want to upload 5 MB of a file; the post_max_size should be more than 5 MB.
This is the size limit for file upload. This should be less than post_max_size.
Serving lightweight resources is an important aspect of browsing. The server serves HTML, CSS, and js resources. Enabling compression will drastically reduce the size of resources, making websites faster.
How to Clone a Website
Here we will talk about how to migrate/ Clone a websites and custom PHP websites.
- Clone a Website Using a Plugin
WordPress Ecosystem has loads of plugins for website, backup, and restore. Following is the list of plugins widely used for migrating and cloning:
- All in One Migration (https://wordpress.org/plugins/all-in-one-wp-migration/)
- Duplicator (https://wordpress.org/plugins/duplicator/)
- WP Vivid Backups (https://wordpress.org/plugins/wpvivid-backuprestore/)
- Updraft (https://wordpress.org/plugins/updraftplus/)
- BackupWP (https://wordpress.org/plugins/backwpup/ )
All plugins are easy to use. It is just a one-click step to Export/Import.
- Install & Activate the plugin of your choice.
- In the plugin option, click on Export.
- Download the exported file on your local machine.
- Head to the new WordPress site. We recommend a blank WordPress site.
- Install & Activate the same plugin of your choice.
- In the Plugin option, click on Import and upload the downloaded files, and you are done.
- Clone a Website in a Manual Way
Most WordPress websites are migrated using the plugin. Cloning a website using the Manual way is only required when the size is bigger in GBs. Also, if you have a custom PHP website, cloning has to be done manually. In Manual migration, the process includes two parts: PHP Files and Database.
- Use Filemanager / Terminal to create an archive of PHP Code.
- Download the archive to Local Machine.
- Use PHPMyAdmin / Terminal to Export the Database into Compress Archive.
- Download the archive to the Local Machine.
Restoring the Site After Cloning
- Move the PHP code Archive to the new server’s desired location, usually the public_html folder.
- Create a database, database user from Database Wizard.
- Use PHPMyAdmin / Terminal to import the Database Archive.
- Once the database archive is imported, head to the File Manager.
- Open the Database configuration file. In WordPress, you can update the Database name, Username, and Password function in wp-config.php.
- If you are migrating the WordPress site manually, use PHPMyAdmin to update site_url and home parameters to your new URL in the wp_options Table (wp_ is just a prefix. This may vary from installation to installation).
- Once you are done with site_url and home, you can log in to WordPress Dashboard. We recommend using Search Replace plugin (https://wordpress.org/plugins/better-search-replace/) to update all URLs
Voila! You are done migrating/Cloning the Website!
If you are using any managed host, it offers free migration services. This also takes care of backing up the website, moving the site, and migrating the database.
Post Migration/Clone Checks
Migration is a tedious process. It may break your website. Crosschecking if your website is working properly or not is an essential thing to do. If you have migrated a WordPress website, then using the Site Health Status option in WordPress Dashboard > Tools > Site Health is the best place to investigate the post-migration errors.
Using Broken link Checker to crosscheck the links is a must-do. 404 Error is a common issue post-migration.
Copy, migrate or clone a website can be done both using a plugin and manually. Fortunately, both ways are easy to implement, depending on your need. We hope this article has proven to be of great help to you in cloning/migrating your website. Do let us know your queries and suggestions in the comments below.
How can I clone a website?
Website cloning can be done using various tools and technologies. One common method is to use website copying software or scripts that download the site’s HTML, CSS, images, and other assets. However, this should only be done for legal and ethical purposes.
What precautions should I take while cloning a website?
Always ensure that you have the legal right to clone a website. Additionally, be mindful of the website’s terms of service and robots.txt file, which may contain guidelines for web crawlers. Respect these rules and limitations.