Automate Clone of Database/Files

Good evening,

I have been looking around for a way to automate cloning from one environment to another. Does someone have an implementation in place?

I could configure a Terminus command to run from an external machine, but it would be nice to do this all on Pantheon.

Thank you!

Hi, @uotonyh! Thanks for posting your question on our forum! I wanted to share some thoughts on this from Pantheor, Eric Michalsen! They said that Quicksilver would be an option if the action would fire on any of the 7 hooks and what you are cloning is within the 120 seconds. Otherwise, they recommend using Terminus.

For us, pretty much none of our databases fit within the 120 second limit, so we wrote scripts that we run to create backups of our accounts before we do deployments. Our plan is to someday incorporate database clones into that process because we can (essentially) make a backup of the live environment before deployment and then back-publish that environment to test and dev all in one go. That said, running our backup scripts already takes like 90 minutes (we have multiple accounts, some that are very large) so we’re a bit concerned about how much longer it would take with cloning operations included.

Regardless, @uotonyh, maybe our thinking will help advance your own.

@uotonyh you are half-way there with the external machine running terminus. now use quicksilver hooks to fire off terminus jobs via an API call. Back in my dev days I had terminus commands fired off from slack commands. This isnt that different. On a QS deploy to live have the QS do a REST call/ping/what have you to your machine to fire off the Terminus to clone db and files to all the env’s you need.