The Copy Maker module will let you copy a site and paste it into another existing site from the WordPress multisite network. Everything will be duplicated: posts, pages, comments, categories, tags, widgets, menus, media files, settings, users, and so on.
All the data of the site that you will paste into, will be replaced with the data of the site you are copying, except the site URL. Therefor the site you paste into will be completely and permanently deleted.
How to copy a site?
- Decide which site you want to copy and which site you want to paste into. The one you paste into will be completely lost and replaced with the one you are copying.
- Find out what is the ID of the site you want to paste into. By default Beyond Multisite adds a column with the ID on the Network Admin Sites Screen. This feature can be turned on or off from the settings of the Improvements module.
- From the Network Admin Sites Screen click on Copy under the site you want to copy. All sites except the main one, can be copied.
- A box with a form will appear. Enter the ID of the site you want to paste into.
- Click the button Copy Site.
- Read the confirmation message and make sure that these are the correct sites you want to copy and replace. If everything is correct, click OK to start the process.
- When the process is completed, you will see a message and links to the newly duplicated site.
- If there were any links or URLs in the posts, pages, comments, widgets, options, and so on, of the site you copied that begin with the site URL, their copies in the site you pasted into have been updated to begin with the new site URL (so they still work correctly).
How to automatically copy a template site into a newly created site?
If you want new sites to automatically become copies of a site (we call it a template site), you can enable this feature. The main site of the multisite cannot be the template site.
To enable it go to the Copy Maker module settings, put the checkbox on Replace new sites with a copy of a template site upon their creation, enter the ID of the template site below and update the settings. You can also choose some other useful settings there, which are described below here on this page in the Module Settings section.
How to view logs of copied sites?
- From the Network Admin Screen click on Sites and then on Logs of copied sites.
- If there are any stored logs, you will see them in a table. To view any specific log, click on View in the Actions column.
Module Settings
To see the settings go to the Beyond Multisite page in the Network Admin Screen and click on Show Settings in the Copy Maker box.
The first setting is for how many logs to be stored. It affects both normal copies and automatic template site copies.
Normal site copy settings
The settings below affect the copy process that starts when you manually click the link to copy a site:
– Do not copy posts (still copies them, but it deletes them at the end)
– Do not copy pages (still copies them, but it deletes them at the end)
– Do not copy categories (still copies them, but it deletes them at the end)
– Do not copy tags (still copies them, but it deletes them at the end)
– Do not copy media files (actual files are not copied, attachment posts are still copied, but it deletes them at the end)
Template site copy settings
All other settings affect only the automatic template site copies made upon site creation (if enabled). You can choose to not copy over sites created by a Super Administrator (the capability manage_network is checked actually). There is a field for the template site ID, which is required and cannot be the main site ID.
The next setting is for the amount of time the site should initially be copied until it is interrupted to continue later. To further explain that, lets describe how things work. Right after the new site is created (in the same request), the plugin will start replacing it with a copy of the template site. Usually this is very fast, but if the template site is bigger or the server is slower, it may require more time than what would be comfortable for the user to wait (or also than what is available in one request before being stopped by the server). In this case the copy process will continue from where it left of when the new site is visited for the first time. The visitor will see a message, and the site will be unusable until the copying process is completed. You can choose the amount of time to spend copying in the initial request, before deciding to interrupt the process and postpone it to be finished on the first visit of the new site.
The next settings is about copying users, and you have these options:
– Do not copy the users from the template site
– Copy these users from the template site, that do not exist in the new site: The users that already have a role in the new site will be skipped, the other ones will be copied.
– Replace the existing users in the new site with all the users from the template site: This will actually delete the existing users and replace them with the ones of the template site, so not really suitable if you are allowing users to signup, because they will lose their site automatically right away.
And the last options are these checkboxes, which are self-explanatory:
– Copy the title of the template site
– Copy the admin email address of the template site
– Notify the network administrator via email if there was an error during the copy process
– Do not copy posts (still copies them, but it deletes them at the end)
– Do not copy pages (still copies them, but it deletes them at the end)
– Do not copy categories (still copies them, but it deletes them at the end)
– Do not copy tags (still copies them, but it deletes them at the end)
– Do not copy media files (actual files are not copied, attachment posts are still copied, but it deletes them at the end)