Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Let's add a checkbox to the import form with the label:
Overwrite existing site?
...and the description:
Checking this option will delete the site with the same name (if it exists) before importing the new site,
If the option is checked (it would be off by default), we would simply add a "Delete site" task to the queue before doing anything else. A backup would get taken automatically as part of that task. This would technically be doing more work than a pure DB + files sync, but it would be really easy to implement.
Comments
Comment #2
colanHere's as far as I could get without taking the time to understand the Batch API.
The existing site gets deleted if the box is checked, but then the process hangs at 60%:
I'll leave this as-is for now. Feel free to take over.
Comment #3
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedCouldn't this be done easier by overwriting the site instead of adding a delete step? (I agree that It does sound safer/cleaner to first do the delete...)
Internally provision-deploy is used, which we also use when a site is migrated between platforms. In that case we also don't delete the site first.
--
just my 2 cents
Comment #4
colanSo it might just work if we loosen the form validation, which checks if the site exists? Sounds like it's worth trying.
Comment #5
colanThis seemed to work for me, but could use more testing. I changed the site name, imported over it, and then the site name went back to what is was before.
@helmo: If we can get this in, what do you think about deprecating hosting_sync? The UI/UX for this is better.
Comment #7
colanLe's handle the deprecation discussion in #2974634: Deprecate hosting_sync in favour of hosting_remote_import.