Closed mtprell closed 6 years ago
Hi @mtprell,
The site cloned successfully although the source database was not installed.
I am not clear on this part. Did your source site not have the CMS installed?
If you want to try a database clone again, without code or media files, you can run terminus site:clone <source.env> <destination.env> --no-code --no-files
.
Please also make sure you have the latest source downloaded as we fixed a bug recently.
Sorry if that wasn't clear. What I meant was that the source site database was not cloned to the destination site.
I downloaded the latest source, and tried the db-only option, but got the following error:
Fatal error: Uncaught Error: Class 'Pantheon\TerminusSiteClone\Commands\TerminusNotFoundException' not found in /Users/prell/.terminus/plugins/terminus-site-clone-plugin/src/Commands/SiteCloneCommand.php:189
I then tried cloning a different site, with the same result: the source db is not copied to the destination.
Looking through the status messages I get from terminus, I see no mention of the db other than the initial backup of the destination code, database and media files, although there are messages for code and media files successfully importing.
Can you try these steps to install the plugin.
~/.terminus/plugins
. For example git clone https://github.com/pantheon-systems/terminus-site-clone-plugin.git ~/.terminus/plugins/terminus-site-clone-plugin
cd ~/.terminus/plugins/terminus-site-clone-plugin
composer install
terminus site:clone -h
terminus site:clone <source.env> <destination.env> --no-code --no-files
If these steps do not work then perhaps we can get on a call sometime to debug.
That worked! I was able to clone the database, and then I ran the plugin against another source site and it cloned this new site as well.
Thanks so much for developing this plugin. We've been trying figure out a way to do this and this works perfectly for our use case.
Awesome! Glad to hear that worked.
We've been trying to figure out a way to do this and this works perfectly for our use case.
Mind expanding on this? I'm interested in hearing what folks are using it for.
We build many sites that are very similar (university departments), use similar themes, templates, content types, etc., so we like to have starter site that includes all of the above. We can also build new features on the starter site and then have them available to all future sites. Config management didn't quite get us there, so being able to clone or copy our starter site is exactly what we needed.
Thanks for the update! I'm actually drafting a blog post announcing this plugin and think the use case you described is a powerful one.
I would encourage you to think about combining the starter site with a custom upstream. That way code updates can be pushed to existing sites as well. The site:clone
would come in when making new projects. You can start with the upstream then bring over files and database from your starter site to kick off the project.
We've considered the upstream, but we decided that we don't want theme code updates pushed to existing sites. We already have a custom upstream for our preferred Drupal modules and base themes. The sites we build are similar, but not the same. Just having a starter site with common theme elements and Drupal configurations is a win for us.
The sites we build are similar, but not the same. Just having a starter site with common theme elements and Drupal configurations is a win for us.
Good insight - thanks for sharing!
I've installed the plugin and run the basic script. The site cloned successfully although the source database was not installed. Is there an argument for that, or should I be importing the db manually (my test db was only about 2MB)?