Technically it is possible to create new sites by cloning an existing site database/dataroot and this is sometimes done to copy default configuration and setup. Overall this is not how we would recommend setting up a site that will be used in production - we recommend installing each site from scratchWhen setting up a new site it is common to want to start with some default configuration and setup. One way to achieve this is to clone the database and sitedata from an existing site. When this is done, often everything will appear to work fine, but there are some subtle issues caused by clonin which can cause significant problems on a production site.
Therefore we strongly recommend doing a fresh install for any site which will be used in production. See below for more information on our recommended approach and things to consider if you are cloning from a backup.
- Create a new site from scratch with an empty database and data root.
- Install the site using the normal install procedure (CLI or via the web).
- Consider creating a flavour plugin (see comments in /totara/flavour/classes/definition.php for how to create a flavour) to set initial configuration and default settings.
- To set up any default content, create a local plugin and use db/install.php or CLI scripts to create any default content.
We would recommend that if at all possible you should unset the site identifier and allow a new value to be generatedgenerate a new one by calling the moodlelib.php function get_site_identifier(). However this will need to be assessed on a case by case basis taking into account the following possible impacts: