Problem/Motivation
We introduced a UI to perform Drupal site upgrades in #2281691: User interface for migration-based upgrades - this added the option to rollback. Which given the use-case probably does not make much sense - given that the UI is designed to be used on a fresh install and it is completely untested #2678994: Write tests for rollback.
Proposed resolution
Remove the rollback through the UI option prior to 8.1.0. We can always add it back if we find a use-case or need to. But we can add it back with tests.
Remaining tasks
Agree that this approach makes sense.
User interface changes
Remove the rollback option from the migrate UI.
Before
After
API changes
Depends on the solution.
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#38 | 2683421-38.patch | 21.69 KB | hussainweb |
#38 | interdiff-34-38.txt | 1.4 KB | hussainweb |
#34 | interdiff.txt | 1.8 KB | xjm |
#34 | 2683421-34.patch | 21.69 KB | xjm |
#30 | 2683421.30.diff-w.to-review-do-not-test.patch | 13.25 KB | alexpott |
Comments
Comment #2
alexpottI discussed this with @benjy in IRC and he said:
Comment #3
alexpottComment #4
alexpottComment #5
xjmHm, rollback was considered a blocker for adding the UI, with the reasoning that site owners needed a way to recover from botched or incomplete migrations (i.e. an unrecoverable state).
I could see the case that the rollback itself isn't safe either, but if we removed it from the UI I think we would in turn need to do a lot more to make it clear that the D8 site you're migrating into is considered 100% disposable. I guess let's get more feedback.
Comment #6
alexpott@xjm good point - but also the migrate UI is doing ID replacements so migrating to an existing site would be very very very unwise. In fact thinking about we should have some warnings about that in the UI.
Comment #7
benjy CreditAttribution: benjy at PreviousNext commentedIt was always my understanding that the upgrade process would have to be into a fresh D8 install. I believe if we provide rollback in the UI, then obviously non-developers will be using it and we could end up with some really edge case bugs that are side-effects of rolling back and migrating many times.
Rollback is a feature best exposed in a more developer orientated tool like the contrib UI and drush runners.
Comment #8
catchI agree with removing rollback support from the UI for now.
We can open an issue with patch -p1 -R to add it back, but seems a lot easier to add signposts for people that they should use a disposable install (possibly a tour?) than trying to support rollback, especially while migrations themselves aren't 100% yet.
Comment #9
Gábor HojtsyWe can test how much content/users/roles, etc. there is on the site before the migration and warn people about it in this UI module if we think this is targeted only at empty sites, right? I don't have a strong opinion on the removal either way.
Comment #10
mikeryanI'm not strongly opinionated on this. It seemed like a good bang-for-the-buck feature at the time - although the primary upgrade scenario is always starting entirely from scratch, for little effort we made it easier to turn things around a bit quicker than a site-install. If the consensus is to enforce rebuild-from-scratch, that's fine.
Comment #11
xjmSo currently, when a migration has already been done, the user has a choice to either perform an incremental migration or roll it back.
Should we disallow either for now, or should we just always perform an incremental migration? I was going to suggest the latter, but I think the incremental option is actually broken as well because both locally and on simplytest.me I get this when attempting to rerun the migration:
Removing the option entirely would actually be an internal API change (which is okay too because the module is alpha-experimental).
Comment #12
xjmAttached would just disallow running a migration if the migration had already been performed. It also removes the untested code paths so that they can be re-added one they are stable and tested.
Comment #13
xjmAnd how that would look in the UI:
Comment #14
xjmComment #15
xjmComment #16
quietone CreditAttribution: quietone as a volunteer commentedThe msg in #13 states 'back up your data'. What data is that referring to?
Comment #17
benjy CreditAttribution: benjy at PreviousNext commentedI think this is because on the testbot it has multiple database engines available but you only have 1. There is a fix for that in the UI improvements issue and the plugins issue.
Comment #18
alexpottSo testing incremental on 8.1.x it works for me however - it is completely broken after the migrate as plugins patch :(
Personally I think we should expand the scope this issue to remove the untested parts of the Migrate UI and then we can file issues to add each feature back with test coverage.
Comment #19
xjmComment #20
xjmI do actually have multiple database engines, so there is some other bug affecting my environment as well as simplytest.me at least on 8.1.x.
Well, we always say this for destructive operations. ;) In this case, presumably anything in the D8 site that is not from the migration.
Comment #21
catchWe probably need to re-word that, since people aren't going to be able to restore their backup into a migrated site, they just shouldn't run a migration on a site with content at all.
Comment #22
alexpottCreated #2687307: Fix Migrate UI form when incremental or rollback selected to fix the incremental / rollback UI - well at least how the plugin patch broke it.
Comment #23
xjmRegarding #21, the first step of the form currently says:
Even though the intro says:
So it's not introduced here at least.
Comment #24
xjmOTOH https://www.drupal.org/node/2350603 does say in big letters "Do not configure the Drupal 8 site" so maybe we can just link the migrate handbook instead.
Comment #25
xjmMy previous patch no longer applied and also had left some dead code paths. After going over this again, I'd recommend we refactor so that a single batch
run()
method does not handle both incremental migrations and rollbacks, and probably also that the rollback form builder has separate handling. The long conditionals that assume in some places "what is not rollback is import" but in other places "what is not import is rollback" without actually checking the submitted option are problematic to maintain.Attached leaves in some unused control structures with some @todos instead (they need followups added). No interdiff because the patch was completely recreated. Obviously the
if (TRUE)
is also not really shippable but it should make it clearer in the followup where to cut on the dotted lines.Comment #26
xjmSorry, #25 was only half the patch. Here is the full one.
Comment #27
tstoecklerJust wanted to throw this out there, I apologize if this is off-topic of leads to derailment:
If the only supported usage is a one-time operation directly after a fresh install why not make this an installation profile?
Comment #28
alexpott@tstoeckler because you have to choose which to enable modules to get all the migrations.
Comment #29
tstoecklerHmm... yeah I thought about that as well. Still would be nice, and - I think - doable to select the modules as part of a profile, but that should not hold this up. Will play around with it and open a follow-up if there's anything there. Thanks for the feedback, though.
Comment #30
alexpottI think we should just completely disentangle the forms in the future so rather than just do
if (TRUE) {
I think we should just re-indent the code - yes this patch is going to get messy but the result will be far easier to maintain.Here's a patch that does that and also removes a code path in ::validateCredentialForm() that this patch makes unreachable as it would only get executed for incremental migrations. Also attached a patch that is simpler to review generated with
git diff -w
to exclude whitespace differences.Comment #31
xjmThe original patch did reindent. As I said, I obviously don't consider
if (TRUE)
shippable. It was just to show the issue with the entangled logic.Comment #32
alexpott@xjm sorry - my bad - I should have read
from #25. I was just concentrating on removing the obscure code path from
::validateCredentialForm()
and removed theif (TRUE)
in the name of consistency in removing dead code paths.Comment #33
xjmAdded followup issues:
Comment #34
xjmAttached adds a @todo for the redundant control structures in the batch runner (
if
s where noelse
is possible, same as in the form builder). I filed a followup rather than doing it in this issue because I want to make sure we get these options out of the UI ASAP and not block it on the correct way to refactor these controllers.Comment #35
hussainwebIt's a pity we are removing these. I don't care too much about rollback but incremental is very useful. I needed to keep running migrations repeatedly when testing this out today and i can't imagine reinstalling the site every time I want to try again.
I see why it might be better to just rebuild the thing from scratch later but can't we keep it and improve it here itself, considering that the entire module is considered experimental? There are two warnings when enabling the module from the UI. Isn't that enough to tell people that things might not work as they expect?
As for the errors in migrate UI when we changed everything to plugins, I just found that issue today and posted a patch. I created #2691189: Rerunning a migration results in an error which I found was duplicate of #2687307: Fix Migrate UI form when incremental or rollback selected. Both patches fix it in a very similar way. Can we not just go ahead with that for now and fix the UI here?
If, ultimately, the migrations can be run repeatedly through some other means (like drush), it is okay. In any case, I don't mind the forms not working eventually considering that I know this is marked experimental.
To clarify, I agree that probably rollbacks don't make much sense and maybe that can be removed, but instead of removing ability to rerun, let that be the default option and provide another option to start over.
Comment #36
xjmIn general @hussainweb I totally agree. Incremental migrations are a required part of the functionality, which is why I marked #2687843: Add back incremental migrations through the UI as a Migrate critical.
That was what I tried at first, but unfortunately it was critically broken as described in #11 -- it did not work at all. And we need to finalize what will be in 8.1.0 now-ish. We can add this functionality back to the UI in 8.1.1 or such because it is an experimental module, but I'd rather ship with only actual support for things rather than pretending to support it and not supporting it. So this issue is essentially a hotfix for the beta, and once 8.1.0 is out we can add back support properly and with test coverage.
Incremental migration should still work with Drush, just not via the UI form.
Comment #37
bojanz CreditAttribution: bojanz commented+1 to #36, thanks for clarifying.
Comment #38
hussainweb> Incremental migration should still work with Drush, just not via the UI form.
Thanks! I can live with that for now.
I was wondering if we should at least make it possible for the user to start over? In other words, a button on the overview form that clears the state 'migrate_drupal_ui.performed'. This lets you use the form at least to start over if you know what you are doing. This would not be incremental migration, just starting over. I think it could be as simple as removing the
return $form;
at line 706 (after applying the patch). I don't want to derail this issue and so if you think it's not worth it, it's fine.Fixing a typo in the patch. I see links to followups are present in comments. Above notwithstanding, +1 to RTBC. I just fixed a typo, so I am assuming it is okay for me to RTBC.
Comment #39
xjmThanks @hussainweb! That typo fix looks good to me.
I think though starting over on top of a previous migration actually is incremental migration? As far as I can tell from the UI module code anyway; incremental migration is the exact same code path as a fresh migration in the batch. If I'm mistaken though we can look into it in a followup or in #2687843: Add back incremental migrations through the UI.
Comment #40
hussainweb@xjm: I think you're right. Let's leave it for the followup then. If somebody really wanted to do this, all they'd have to do would be to reset the state (which is possible with drush).
Comment #41
catchNit. Could use a comma after 'within that'.
Couldn't find anything else. I'll give this another once over a bit later on, and commit if that's still the case.
Comment #42
xjmI think #41 is just reindented; might want to check it locally with a
git diff -w
.Comment #44
catchI'd add to #36 that we're still finding quite nasty bugs like #2682705: Migrate process plugin does not save stubs to the idmap, leads to duplicates and broken references / #2690001: Migrate: Don't deduplicate forum vocabulary. Originally #2682705: Migrate process plugin does not save stubs to the idmap, leads to duplicates and broken references looked like an issue with incremental migrations, but it's was an issue with any migration that uses stubs.
I'm hopefully that the migrate UI will result in lots more 6.x migrations being tested on a wider variety of sites, which should in turn lead to more bug reports. But when looking at those, it's good to have the least possible variables we can for the moment. So removing this then putting it back in to 8.1.1 or similar seems very sensible.
Committed/pushed to 8.1.x and 8.2.x, thanks!
Comment #46
xjmWe should call this out specifically in the experimental modules section of the release notes.
Comment #47
webchick