Often I want to "reinstall" a site from scratch for various reasons. This is especially true with DevShop, which is more of a development and testing platform, we need to "reinstall" all the time.
I've acquired some of that "Aegir Tribal Knowledge", so I know how to do this in a few steps:
- Delete a site's
site_path
. - Run
drush @sitename provision-install
ordrush @hostmaster hosting-task 123 --force
. - Run a verify task in the front end to update any information.
- Cry a tear as I remember there is now an "orphan" database that I'll have to delete manually, or never.
DevShop's method of "rebuilding" an environment database was "provision_sync" project, which is shaky at best. It often fails.
In devshop, we now only use "Install" tasks, even if we are "cloning" another environment. This will make it easy to "reinstall", if we can just automatically remove the database and sites folder before the install kicks off again.
I've managed to make this work with this patch and branch.
Comment | File | Size | Author |
---|---|---|---|
#12 | allow_force_reinstall-2836185-11.patch | 2.08 KB | helmo |
#6 | 2836185-force-reinstall.patch | 1.53 KB | Jon Pugh |
Comments
Comment #3
Jon PughComment #4
Jon PughI'm including this patch in the next release of devshop.
It works!
Comment #6
Jon PughSorry about the bad patch. New branch pushed with just these changes.
Comment #7
Jon PughAbout this...
I tried 6 ways from sunday to get the database name somehow. All null.
The problem is that the credentials aren't loaded until after drush validation hook, and when they are, they load a new database name.
We should really consider making it easier to figure out what database the site is using!
Comment #8
Jon PughErgonlogic was kind enough to point me to https://www.drupal.org/project/hosting_reinstall and https://www.drupal.org/project/hosting_dev.
I'm going to propose to put hosting_reinstall into hosting_tasks_extras in #2838431: Add Hosting Site Reinstall to hosting_tasks_extra
Comment #9
Jon PughActually I think this patch still has merit. I had problems with running the reinstall. This would be a simple backend, CLI API only addition, for now. Creating a UI for this is secondary.
Comment #10
Jon PughSee branch 2836185-force-reinstall
I'm still including this in devshop.
Comment #12
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedJust tested and seems to work fine ... I added a line to document the option on the branch.
I'd say RTBC ...
What if hosting_reinstall we're just a frontend for this --force-reinstall option.
Comment #13
colanMight be overkill if that's all it's doing. Given that the back-end is in core, why not put the front-end in core too?
Comment #15
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedMerged
One reason to not have the ui in core would the that it's a 'risky' one for new users to have available by default. But I'm open to suggestions.
Comment #16
colanHosting Tasks Extra then?
Comment #18
colanLet's figure out where to create a ticket for the front end task, and then let's close this one.
Comment #22
Jon PughFixed a problem when trying to re-run install tasks for sites that failed.
Comment #23
Jon PughComment #24
Jon PughComment #25
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedgood catch
Comment #27
Jon PughMerged.