WordPress Clone an Instance
From WikiMLT
An easy and robust way to Clone an WordPress Instance is to use the WordPress migration plugin Duplicator , provided by Snap Creek. There are few easy steps you need to do.
- Install the plugin at the source WordPress site.
- Go to the admin menu item "Duplicator" and pass through the three easy steps process in order to "Create new Package".
- Download the newly created
<package>.zip
and theinstaller.php
file. - Setup a new Virtual Host and new a Database for the destination site.
- Place
<package>.zip
andinstaller.php
into the DocumentRoot directory of the new Virtual Host. - Access
https://destination.example.com/installer.php
via the web browser and follow the provided steps.
Optionally, if you need to clone the site at the same server, yo do not need to download the <package>.zip
file, it is located into the directory wp-content/backups-dup-lite/
.
One you finish you must cleanup the source and the destination site directories. One way is by using the command line:
# remove 'ech' in order to do the actual changes
sudo find /var/www -type f -name '<package>.*' -exec echo rm {} \;
Further, for these who don't have the pro version, they can chance the database prefix of the new instance by the help of the plugin Brozzme DB Prefix & Tools Addons (tested on WP 5.7.2).
References:
- Duplicator For WordPress – Quick Start
- WP Staging: 3 Ways to Change the WordPress Database Table Prefix
- WordPress: Changing The Site URL via WP-CLI