- Contributors: pdargham, julienog, daviddaug, globalis
- Tags: duplicate, clone, copy, duplication, duplicator, factory, multisite, site, blog, network, wpmu, new blog
- Requires at least: 4.0.0
- Tested up to: 5.0.0
- Stable tag: 1.5.3
- License: GPLv2 or later
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
Clones an existing site into a new one in a multisite installation : copies all posts, settings and files
MultiSite Clone Duplicator adds a "Duplicate Site" functionality to your network installation.
It allows you to clone any site of your network into a new one : all data, files, users and roles can be copied.
It is useful when you want to create multiple sites from the same template : Don't waste your time copying the same configuration again and again !
Simple and user-friendly, this plugin extends WordPress core network's functionalities without polluting the dashboard.
WARNING : If you clone the primary site, you must use mucd_default_primary_tables_to_copy
filter to declare plugins and custom database tables, or your cloned site won't be complete
- Clones any site of your wordpress multisite installation
- Copies all posts and settings
- Generates log files (if option is checked)
- Copy all files from duplicated site (if option is checked)
- Keep users and roles from duplicated site (if option is checked)
- Configure which site is clonable (so you can define an unique "pattern" site)
- Fully hookable
- Command line ready (provides a WP-CLI subcommand)
You can install MultiSite Clone Duplicator using the built in WordPress plugin installer. It’s easy, 2 seconds.
If you prefer download MultiSite Clone Duplicator manually :
- Upload
multisite-clone-duplicator/
to the/wp-content/plugins/
directory - Activate the plugin through the 'Plugins' menu in WordPress
- (Optional)
Chmod 777
the logs/ directory of the plugin, if you want to activate logs - Go to My Sites > Network Admin > Duplication and enjoy !
- (Optional) Change default options into Network dashboard > Network settings > Duplication
In the future, you'll probably want to create a dedicated "template" blog to clone from.
- It creates a new user if the email was not an existing email
- It creates a new blog with appropriate title and admin user
- It copies all tables from cloned site, but keep some options (like title, domain, etc) of the new blog
- It searches and replaces old site's URL and DOMAINS with the new ones
- It copies upload directory from the old site to the upload directory of the new one (if option is checked)
- It imports users and roles from the old site to the new one (if option is checked)
Yes, it supports both !
Yes you can, but you want to be careful : WordPress saves network tables and primary blog tables with the same prefix, and some of their data are mixed. It forces us to restrict primary blog cloning to copy only the default wp tables. If you want to change this (for example, include your plugin tables in the cloning), use mucd_default_primary_tables_to_copy filter. In the future, you want probably not to copy again and again the primary blog : use a "template" blog dedicated to clonage instead.
Yes it does !
It's not a problem ! Serialized data are understood by the plugin, recursively unserialized, replaced with appropriate values, and serialized again.
Check your host / server configuration : you probably cloned your site into a domain that is not available !
Install WP-CLI, go to your wordpress multisite directory, and type
wp-cli site duplicate --source=<id_of_the_site_to_clone> --slug="<slug_of_the_new_site>"
Arguments are :
wp site duplicate --slug=<slug> --source=<site_id> [--title=<title>]
[--email=<email>] [--network_id=<network-id>] [--private] [--porcelain] [--v]
[--do_not_copy_files] [--keep_users] [--log=<dir_path>]
As of now, following languages are supported : English (en_US), French (fr_FR), Spanish (es_ES), Lithuanian (lt_LT) and Greek (el). If you wish to, you can translate the interface in your own language in the standard WordPress way or with Transifex
Globalis media systems is a web IT consulting company based in Paris, and a pioneer of the PHP and LAMP platform. Since 1997, we have been designing, making and maintaining Internet, intranet or mobile software. We have been working with open source CMS since 2000 and have regularly been using WordPress since 2007.
Screenshots on wordpress.org
- Test compatibily with Wordpress 5.0.0
- Improvement translations
- Fix unix file path from log directory
- Fix file path on duplicate
- Fix compatibility with PHP version < 5.4
- Fix duplicating exponentially usermeta
- Fix unix WP path validation and allow points
- Remove cache flushing on error
- Fix wp_cli activation
- Added select2 support (Ajax dropdown when selecting site)
- Restrict activate to network admin only (network admin area)
- Default logs path moved in upload dir
- Added language zh_CN
- Bugfix : SSL compatibility
- Bugfix : Compatibility : WordPress 4.7 (wp_get_sites was deprecated)
- Bugfix : Check on admin referer broke some admin page
- Bugfix : Compatibility with PHP 5.2
- Added wp-cli site duplicate subcommand
- Added default options in network settings pannel
- Languages : added translation for spanish, lithuanian and greek
- Bugfix : Using backtricks on CREATE TABLE LIKE
- Bugfix : Remove HyperDB compat. : it made some bug on schema / table selection
- Bugfix : duplication of tables without primary key / with several primary keys was causing SQL error
- Bugfix : escape underscore characters ( '_' ) in sql queries
- Bugfix : "Keep users and roles" was broken
- Bugfix : Compatibility with plugins that use reserved mysql words in table names
- Bugfix : Partial compatibility with HyperDB
- Tested on WP 4.0.0
- Bugfix : Compatibility with PHP 5.2
- Bugfix : SQL Error replace mysql_real_escape_string by $wpdb->prepare
- Bugfix : unable to delete, deactivate, etc. site when plugin is active
- Bugfix : Fields in duplicate form lost information after validate with error
- First public version released by Pierre Dargham
- Generates logs
- Primary site is clonable
- Auto-suggest for admin email
- Keep users and roles from duplicated site
- Translating
- Hookable
- Initial version released by Julien Oger
- Copies all the posts, settings and files from a site to a new one
- Cannot clone primary site
Action before / after copying files
Args :
- Int : from_site_id
- Int : to_site_id
Action before / after copying data
Args :
- Int : from_site_id
- Int : to_site_id
Action before / after copying users
Args :
- Int : from_site_id
- Int : to_site_id
Filter args to retrieves a list of network sites (function get_site_list) Args :
- Array of ( 'param' => 'value' )
Filter args to retrieves a list of network sites (function get_sites) Args :
- Array of ( 'param' => 'value' )
Filter options that should be preserved in the new blog (original values from created blog will not be erased by copy of old site's tables)
Args :
- Array of string : option_name
Filter fields to scan for an update after data copy
Args :
- Array of ( 'table_name' => array('field_1', 'field_2' ...));
Filter tables to duplicate when duplicated site is primary site
Args :
- Array of string table_name
Filter directories and files you want to copy
Args :
- Array of string : dirs
- Int : from_site_id
- Int : to_site_id
Filter which strings we want to replace during update
Args :
- String : string_to_replace
- Int : from_site_id
- Int : to_site_id
Arguments are :
wp site duplicate --slug=<slug> --source=<site_id> [--title=<title>]
[--email=<email>] [--network_id=<network-id>] [--private] [--porcelain] [--v]
[--do_not_copy_files] [--keep_users] [--log=<dir_path>]
The original version of this plugin has been developed by Julien OGER who keeps following the project carefully.
Some code for search and replace in SQL serialised data were initialy taken from Lionel Pointet Wordpress Migration tool