Follow-up to #2687843: Add back incremental migrations through the UI
Problem/Motivation
Follow-up to #2683421: Remove incremental and rollback options from the UI (and add them back when they are more stable) which removes both the rollback and incremental options since they were untested and had several significant bugs. Unlike the incremental migration feature, rollback can probably be considered an additional feature and not necessarily block a stable Migrate UI.
Proposed resolution
Add back rollback migration support to the UI, with test coverage.
Only roll back content migrations, not configuration. This is because
- It is hard to roll back configuration reliably, since it can also be changed in other ways.
- It may be more useful to use the regular configuration management, after an initial migration, than to update, roll back, and re-run the configuration migrations.
Use the phrase 'incremental upgrade' instead of 'Rerun' as shown in the now dated screenshot. See #32
Check for NULL
in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
. This fixes a bug that was exposed by the new test coverage.
Add a link to Upgrade using web browser and update that page to describe the new option. Suggested text:
If an upgrade was not done then the Upgrade page provides information about the preparation steps that should be done before continuing with the upgrade. However, if an upgrade was done then you are asked if you want to import new configuration and content or to rollback the upgrade. If you continue, for any of these situations, you are then asked to define the source site.
Remaining tasks
- Implement the new, reduced scope: only roll back content migrations.
- Update the documentation in the handbook,
User interface changes
Before
After
Default is incremental
Selecting the Rollback
Druing rollback complete
Rollback complete
API changes
Depends on the solution.
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#200 | 2687849-200.patch | 15.38 KB | _utsavsharma |
#199 | reroll_diff_190-199.txt | 18.18 KB | sahil.goyal |
#199 | 2687849-199.patch | 32.54 KB | sahil.goyal |
#191 | interdiff-190.txt | 559 bytes | KapilV |
#190 | 2687849-190.patch | 32.29 KB | KapilV |
Comments
Comment #3
quietone CreditAttribution: quietone as a volunteer commentedThis is postponed on #2687843: Add back incremental migrations through the UI, which has differing opinions on whether it should be implemented or not. In light of that on going discussion, and if rollback is still wanted in the UI, here is a patch for the rollback action. This includes a new confirmation message for both the upgrade and rollback actions.
Also, the proposed resolution includes 'Consider refactoring the form and batch process so the logic for it is not entangled with the initial migration and the rollback option.' Note that there are two existing issues pertaining to that #2687851: Refactor run() method on Migrate UI batch and remove the $operation parameter and #2679929: Reduce method and control structure length/complexity in Migrate UI.
Comment #5
quietone CreditAttribution: quietone as a volunteer commentedUpdated the test to use the new text.
Comment #6
quietone CreditAttribution: quietone as a volunteer commentedHad a chat with alexpott on IRC. The short version is that we agree that rollback is useful. It provides an 'undo' function which is something many expect to have in software. And that means they can then 'undo' instead of re-install to fix simple things like installing or un-installing a module.
What do you think? Time to review this?
Here is the full conversation:
quietone: re the UI and rollback - I really don't know. This is one tricky area
quietone: when talking to other migrate maintainers it seems as though the migrate UI in core is viewed as a one chance casino
alexpott, I was wondering if some would prefer a full rollback and try again, say after install some modules, instead of resinstalling and trying again
s/install/installing/
quietone: that is a possible use-case I guess - but i'd prefer people to re-install. Cleaner. But OTOH this is incremental-lite :D
quietone: that use-case is probably the best use-case for an "incremental" ish thing in the UI. - Something that only allows you to run new migrations that are available.
quietone: But the idea of only have a "do it" and "undo it" button in the migrate UI might be a really good idea.
alexpott, do it / undo it. Ah, that 'feels' right.
quietone: so the workflow is install core & a few modules... run migrate - think nope - rollback - install or uninstall modules - migrate - thing yay!
quietone: feel free to copy this IRC chat into the issue
alexpott, yes, I think that fits for those who will be using the UI.
Comment #7
xjmIf we don't want to add incremental migrations because D6 and D7 did not support incremental updates, wouldn't the same reasoning mean rollback was out of scope, since D6 and D7 did not support rolling back update.php? Also in the other issue one of the statements was that we would not support migration into a non-empty site in core. I don't see the value of supporting rollback in the UI if you always have to start from an empty site anyway. What's the point of rolling back to an empty site?
To me incremental migrations are a much more essential feature than this.
Comment #8
quietone CreditAttribution: quietone as a volunteer commented@xjm, as alexpott said "But the idea of only have a "do it" and "undo it" button in the migrate UI might be a really good idea." I think that is the reason, it gives those working just from the UI a way to 'Undo'. And it means they don't have to re-enter the database credentials and file path information.
Comment #9
kekkisPatch from #5 won't apply.
Comment #10
anish.a CreditAttribution: anish.a at Axelerant commentedRerolled against 8.2.x branch.
Comment #11
mikeryanComment #12
mikeryanI needed to reroll this, patch attached.
With this patch, I was not able to run an import in the first place - clicking Continue on the overview form simply reloaded it without proceeding to the credentials form (not clear on why that is).
Incremental upgrades are not being added, at least in this patch, so no point in adding this constant.
There's not much point to a radio select with only one option. This would probably be better as just a simple value with a description making it clear that continuing will perform a rollback.
Comment #13
mikeryanComment #15
mikeryanComment #16
rakesh.gectcrworking on it.
Comment #17
rakesh.gectcrHad mentioned about this issue in the weekly migration call, according to the priority this will be taking care of end of July 2017.
However worked on roll back against 8.4.x, which is attached.
To do,
/core/modules/migrate_drupal_ui/src/MigrateUpgradeRunBatch.php
No more existing, So that IMHO the following code has to moved to/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php
Comment #18
mikeryanMoving to 8.4.x and reducing to Normal - this is not a requirement for the migration system being declared "stable", which is our goal for 8.4.0, this is new functionality we would target for post-stability.
Comment #19
joelpittetComment #22
quietone CreditAttribution: quietone as a volunteer commentedUpdated the IS to include adding documentation to the handbook. Aside from being a nice idea in general, this is a to do item on #2561249: [Meta] Reorganization of (some) d.o. migration documentation, see #11.
Comment #24
piggito CreditAttribution: piggito as a volunteer and at Skilld commentedRerolling patch.
Comment #26
piggito CreditAttribution: piggito as a volunteer and at Skilld commentedFixing consts misplacing.
Comment #28
piggito CreditAttribution: piggito as a volunteer and at Skilld commentedAdded
./core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeRollbackBatch.php
+ code standard fixes.Comment #29
heddnThis could use some documenting. I'm also going to pend it on #2918761: Break up MigrateUpgradeForm into smaller forms.
Comment #30
quietone CreditAttribution: quietone as a volunteer commentedNo longer postponed, and will need a reroll.
Comment #31
quietone CreditAttribution: quietone as a volunteer commentedIt was reverted, back to postponed.
Comment #32
masipila CreditAttribution: masipila as a volunteer commented1. I created a documentation follow-up and updated the issue summary accordingly, see #2947498: Document Migrate Drupal UI rollbacks.
2. Regarding the UI for this. The original screenshot what this used to look like back in the days said 'Rerun'. I propose we use the term 'Incremental upgrade' consistently.
Cheers,
Markus
Comment #33
quietone CreditAttribution: quietone as a volunteer commented32.2 I agree and have updated the IS. We can add a UX review when this is ready to be sure, but it is certainly better than 'rerun'.
Comment #34
quietone CreditAttribution: quietone as a volunteer commented#2918761: Break up MigrateUpgradeForm into smaller forms has been committed.
Comment #35
quietone CreditAttribution: quietone as a volunteer commentedComment #36
rakesh.gectcrAssiging for reroll
Comment #37
rakesh.gectcrComment #38
rakesh.gectcrComment #39
quietone CreditAttribution: quietone as a volunteer commentedSetting to NR for testbot
Comment #41
rakesh.gectcrComment #42
heddnThis is on the roadmap for 8.6, so let's bump priority.
Comment #43
quietone CreditAttribution: quietone as a volunteer commentedNice to see progress here. Tagging for needing a test.
Took a brief look at the patch #28 and it looks like a base class for the Batch would be useful.
Comment #44
rakesh.gectcrUn assigining myself, for time being some one wants to pik it up..
Comment #45
quietone CreditAttribution: quietone as a volunteer commentedLet's bring this up-to-date.
Comment #46
quietone CreditAttribution: quietone as a volunteer commentedThis far from complete. I've added a test, adding a rollback at the end of the existing full migration test. There is a new method, getEntityCountsRollback() to get the entity counts for the post rollback assertions but they are all wrong, it is just a copy/paste from getEntityCounts() because I haven't looked into the counts yet but I wanted to get the test built. Running the tests to see how bad this is.
There is no interdiff because I applied the two patches in #38 and started from there.
Comment #48
quietone CreditAttribution: quietone as a volunteer commentedThis addressed coding standard errors, a adjusted the assertion in FormStepTest for the new text on the Incremental form, and fixes and the problem where I hastily put getEntityCountsRollback in the wrong class.
Still very much a WIP and no need for review yet.
Edit: my fingers really like to name the interdiff wrong these days!
Comment #50
quietone CreditAttribution: quietone as a volunteer commentedOnly a bit of cleanup. Fixed the remaining coding standard errors and changed drupal_set_message to \Drupal::messenger().
Comment #53
quietone CreditAttribution: quietone as a volunteer commentedRerolling the patch.
Comment #55
quietone CreditAttribution: quietone as a volunteer commentedThis may fix two tests, the NoMultilingual ones.
Comment #56
quietone CreditAttribution: quietone as a volunteer commentedComment #58
quietone CreditAttribution: quietone as a volunteer commentedI seem to be at an impasse and don't see how to fix this. Can anyone provide some direction.
Comment #59
quietone CreditAttribution: quietone as a volunteer commentedUn-assigning myself since I can't see the problems here.
Comment #60
quietone CreditAttribution: quietone as a volunteer commentedRetesting
Comment #61
quietone CreditAttribution: quietone as a volunteer commentedThis is failing on the page reload after the rollback finishes.
Maybe this this related one or more of these #2978320: [backport] rdf comment storage load should not load NULL comments, #2614720: Fatal errors while loading/building orphaned comments or #2906470: Orphan comments and entries in comment_entity_statistics after comment field instance has been deleted ?
Comment #62
quietone CreditAttribution: quietone as a volunteer commentedRetesting
Comment #64
quietone CreditAttribution: quietone as a volunteer commentedJust a reroll
Comment #66
firfin CreditAttribution: firfin commentedI seem to have this functionality already? Or is that because it is currently in migrate_tools or migrate_plus already (or for now)?
Comment #67
quietone CreditAttribution: quietone as a volunteer commentedI haven't used migrate_tools in a long time but the core UI does not offer any type of rollback.
Comment #69
quietone CreditAttribution: quietone as a volunteer commentedAnother reroll
Comment #71
quietone CreditAttribution: quietone as a volunteer commentedAdd getEntityCountsRollback() to several tests, remove unnecessary validation from the IncrementalForm and get the migrations from the store for use in the rollback.
Comment #73
quietone CreditAttribution: quietone as a volunteer commentedThe current Upgrade6Test and Upgrade7Test logout the admin user and when I try to log back in as the root user it fails because the password has changed. So, instead of having to keep track of the password from the test fixture this patch makes new tests Rollback6Test and Rollback7Test. This patch also includes the latest patch from #3123095: Rollback of complete node migration fails so that the node complete migration actually does rollback the nodes.
While I am still not fond of testing the entity counts it is the best we have so entity counts are tested post rollback. The counts in the patch are not correct, and I expect failures.
Comment #75
quietone CreditAttribution: quietone as a volunteer commentedAdd the source_base_path for Rollback7Test and some cleanup.
Comment #77
quietone CreditAttribution: quietone as a volunteer commentedUpdate entity counts.
Comment #80
quietone CreditAttribution: quietone as a volunteer commentedAdd related issue to comment, #38 over there.
Comment #81
quietone CreditAttribution: quietone as a volunteer commentedThe patch in needed a reroll and I am curious to see if adding #2614720: Fatal errors while loading/building orphaned comments will fix the error.
Comment #82
quietone CreditAttribution: quietone as a volunteer commentedI'll make a proper rerolled patch after this test.
Comment #84
quietone CreditAttribution: quietone as a volunteer commentedIt appears that the #2614720: Fatal errors while loading/building orphaned comments does improve the outcome here but I can't be sure. I'll have to test locally.
Here is a reroll of the patch in #77
Comment #86
shaktikI am working on testcases
Comment #87
shaktikthe fixing test case, let's wait for the boat.
Comment #88
shaktikComment #89
quietone CreditAttribution: quietone as a volunteer commented@shaktik, thanks for the patch.
There's a typo.
s/issset/isset/
Comment #91
shaktiksorry for typo error, fixed typo error.
@quietone, Thank you for quick check.
Comment #93
shaktikI am trying to fix but not completed still getting some issue in this method
testMigrateUpgradeExecute
, here is the link for the testing patch I tried https://www.drupal.org/project/drupal/issues/3164847#comment-13792232Comment #94
quietone CreditAttribution: quietone as a volunteer commentedMigrateIdMapInterface::currentDestination can return an array, including an empty array. So, instead of isset try !empty.
Comment #95
Vidushi Mehta CreditAttribution: Vidushi Mehta at gai Technologies Pvt Ltd commentedAdded a patch as mentioned by #94.
Comment #96
quietone CreditAttribution: quietone as a volunteer commented@Vidushi Mehta, thank you for the patch. Can you provide an interdiff?
Comment #97
shaktik@quietone,
Thanks for the suggestion I also tried with !empty, but no luck.
Haha Bot's happy. @Vidushi Mehta thanks for the patch. but why you skipped all new files in the previous patch any Specific reason?
Thanks,
Shakti
Comment #98
quietone CreditAttribution: quietone as a volunteer commented@shaktik, thanks for pointing that out the lost files.
So, this needs another reroll, from #91, that adds the fix suggested in #94.
I also noticed that Rolback7Test is a copy/paste of Rollback6Test and that needs to be fixed.
s/6/7
Replace this with the method of the same name from Upgrade7Test
Comment #99
Vidushi Mehta CreditAttribution: Vidushi Mehta at gai Technologies Pvt Ltd commentedRerolled the patch and added the new files which was missed by me to add @shaktik sorry for that. I've added point 2 which was mentioned by @quietone but still point 1 is not covered as I didn't understand this point/change properly. @quietone & @shaktik it would be really helpful if you guys help me in this or @shaktik if you can cover this point.
Comment #101
quietone CreditAttribution: quietone as a volunteer commented@Vidushi Mehta, thanks. Sorry about the confusion. The string 's/6/7', means change 6 to 7 but that is moot because I made a mistake. I was looking at the wrong file so my #98.1 and #98.2 are wrong.
I have made a new patch to correct my mistake. Note this also includes a change in \Drupal\migrate\MigrateExecutable::rollback to check that $map_row is an array.
Comment #103
quietone CreditAttribution: quietone as a volunteer commentedRollback7Test is failing because of recent changes to the functional tests. This patch makes those changes, I hope (it is late).
The Rollback6Test is failing, https://www.drupal.org/pift-ci-job/1796503, on an rdf issue. For that the patch from #2978320: [backport] rdf comment storage load should not load NULL comments should be added. I am not doing that here because I want to see if there any other errors related to the changes in the functional tests. There shouldn't be any.
Comment #105
Vidushi Mehta CreditAttribution: Vidushi Mehta at gai Technologies Pvt Ltd commented@quietone no issues reagrding your commnet on #101. But after all that changes still the Rollback6Test is failing.
Comment #106
quietone CreditAttribution: quietone as a volunteer commentedYes, the tests are failing. In #103 I said that the patch from #2978320: [backport] rdf comment storage load should not load NULL comments is needed. That still needs to be done. But even with that I expect it will fail the same was as the Drupal 7 test.
So, look at the test results for the Drupal 7 test and check out what it is failing on. That will give us an indication of the problem.
Are you setup to run these functional tests locally?
Comment #107
quietone CreditAttribution: quietone as a volunteer commentedRetesting latest patch because #2978320: [backport] rdf comment storage load should not load NULL comments was committed.
Comment #108
quietone CreditAttribution: quietone as a volunteer commentedLet's add a method for testing the rollback results. Modified drupalci.yml to just run the migrate_drupal_ui tests.
Comment #110
quietone CreditAttribution: quietone as a volunteer commentedThat is not what I meant to do. This should be better, though still a work in progress.
Comment #112
quietone CreditAttribution: quietone as a volunteer commentedBetter, now add a string to confirm the rollback and update entity counts.
Comment #114
quietone CreditAttribution: quietone as a volunteer commentedChange some more entity_counts
Comment #116
quietone CreditAttribution: quietone as a volunteer commentedAnd cleanup and fix more entity counts
Comment #118
quietone CreditAttribution: quietone as a volunteer commentedMissed another entity count
Comment #119
quietone CreditAttribution: quietone as a volunteer commentedNow restore drupalci.yml
Comment #120
quietone CreditAttribution: quietone as a volunteer commentedUpdate the IS
Comment #121
quietone CreditAttribution: quietone as a volunteer commentedAccording the IS this should be 'Incremental upgrade' instead of 'Rerun'. Once that change is made a new screenshot needs to be added to the IS to replace the existing one of this page.
Making that change is suitable for a novice task, so tagging.
Comment #122
ayushmishra206 CreditAttribution: ayushmishra206 at OpenSense Labs commentedMade the changes requested in #121. Please review
Comment #123
quietone CreditAttribution: quietone as a volunteer commented@ayushmishra206, thanks. That looks correct. Can you also make a screenshot and update the Issue Summary?
Comment #124
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedFixing test.
Comment #125
quietone CreditAttribution: quietone as a volunteer commented@vsujeetkumar, thanks for fixing the test.
Setting to NW for a screenshot of the changed page. That screenshot should be in the IS.
Comment #126
quietone CreditAttribution: quietone as a volunteer commentedAdded screenshots.
Comment #127
heddnProbably could use a usability review of the screens in the IS. Tagging.
Comment #129
quietone CreditAttribution: quietone as a volunteer commentedDid a self review. Found some items to cleanup and removed use of deprecated code.
Comment #130
quietone CreditAttribution: quietone as a volunteer commentedNeeds a reroll which I will finish tonight.
Comment #131
quietone CreditAttribution: quietone as a volunteer commentedRerolled and removed third parameter from a call to updateEntity that looks left over from an earlier design of this.
There are no changes that warrant creating new screen shots.
Comment #132
quietone CreditAttribution: quietone as a volunteer commentedComment #133
quietone CreditAttribution: quietone as a volunteer commentedComment #134
quietone CreditAttribution: quietone as a volunteer commentedComment #135
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedComment #136
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 for Drupal India Association commentedre-roll the patch.
Comment #137
quietone CreditAttribution: quietone as a volunteer commented@kishor_kolekar, can you add the interdiff? There are instructions for creating an interdiff in the handbook.
Creating the diff is suitable for a novice, adding tag.
Comment #138
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 for Drupal India Association commentedThanks, @quietone for your feedback...
Comment #139
benjifisherUsability review
We discussed this issue at #3182480: Drupal Usability Meeting 2020-11-20.
The interface text looks fine. The only thing we did not like was handling the documentation page in a separate issue. Instead of adding the documentation page in #2947498: Document Migrate Drupal UI rollbacks, can we add it as part of this issue?
If you think that the documentation deserves a new page, then we can add the page now, but do not add it to the menu of the Upgrading Drupal guide. In practice, no one will find the page until we add it to the menu, but to be safe we can add a note at the top that it depends on this issue being fixed.
If you think the new documentation should be part of an existing page, then we could add a stub section now, saying that rollbacks will be possible once this issue is fixed. We could add a draft of the final text as a comment to this issue.
Either way, the patch here should be updated to add a link to the new documentation. I am setting the status to NW for that.
Probably this issue should also have a change record. I am adding the tag for that.
Last point: the new option says,
The new documentation should expand on that, with examples. I read that sentence two or three times before I realized that the key word is "entities".
Comment #140
quietone CreditAttribution: quietone as a volunteer commentedChange record added.
Closed #2947498: Document Migrate Drupal UI rollbacks based on the usability review.
What is still to do is to add the documentation and update the patch. Leaving at NW
I think the documentation should be on the existing page, Upgrade using web browser, in a new section 'Starting the upgrade'. The new section would be for discussing the Overview Form, which has a version for when no migration has run and for when a migration has run.
Comment #141
quietone CreditAttribution: quietone as a volunteer commentedUpdated Upgrade using web browser, with a new section, 'Start', that will be explaining the Overview and Incremental forms.
I have removed the word 'entities' from the text for two reasons, one is the comment in #139 and the other is a memory of reading an issue that I can no longer find about not using the entity is user facing text. I reckon for many folk 'entity' has no meaning but the words content and configuration do and are sufficient here.
Comment #142
quietone CreditAttribution: quietone as a volunteer commentedAnd a new screen shot
Comment #144
quietone CreditAttribution: quietone as a volunteer commentedThat was silly. I changed the text but not the tests.
Comment #145
benjifisherGood call. I think the reference you are looking for is Interface text > Word Choice. But the text now reads,
What is the difference between "configuration", as in "content and configuration", and "other configuration"? Is this variant accurate?
I prefer commas instead of parentheses, but I do not insist on it.
We will need to update the screenshot in the CR to show the updated text.
I am assigning the issue to myself for a code review. I plan to finish today.
Comment #146
benjifisherThis new test class has one test method, which seems to be a duplicate of
MigrateNodeCompleteTest::testRollbackNodeComplete()
.This change looks like an unrelated bug fix. If so, then it is out of scope for this issue. Should we create a follow-up issue, and add test coverage for whatever bug this is fixing?
Same here:
Can we
use StringTranslationTrait
and then use$this->t()
and whatever the plural version is called?Maybe
MESSAGE_COUNT
orMAX_MESSAGE_COUNT
instead ofMESSAGE_LENGTH
:Do we have to allow for the possibility that ’$initial_ids == []`?
I have seen this code before! Should we postpone this issue on #2925899: MigrateUpgradeImportBatch does not use source_private_file_path & source_base_path correctly, making it impossible to have public & private files in separate locations? Better yet, can we avoid duplicating code between the two Batch classes?
In fact, now that I know where to look, I really do not like how much code is duplicated between the two Batch classes. I think some refactoring is in scope for this issue. Also, the last lines quoted above are missing another recent change, #3151363: Double // in file paths.
Do we want to make rollback the default option, not incremental migration? (Is this discussed in earlier comments?)
Break before
->createInstances()
:I think we will have to update the two functional tests once #3175953: Cleanup migrate drupal functional tests is fixed.
Is this method declared somewhere else?
Comment #147
quietone CreditAttribution: quietone as a volunteer commented@benjifisher, thanks for the review.
145. Text changed, no more parentheses.
146.
1. Looks like a left over file. It is not needed. The rollback test is now part of MigrateNodeCompleteTest.
2. todo
3. todo
4. Don't think this can be changed because this is a static method.
5. I'd rather not do that here. Could be a followup.
6. I don't know, I just copied from MigrateUpgradeImportBatch.
7. Added a base class with a method for this bit of code.
8. There has been no discussion of what the default should be. Probably should not change it though, so it is 'Incremental'.
9. Fixed.
10. Yes, that is very likely.
11. There is a method called getEntityCountsRollback in both Rollback6Test and Rollback7Test. Even though those tests are so similar i decided not to make yet another base class.
One new screenshot added. showing the default of Incremental and the new text for rollback.
Comment #148
benjifisher@quietone, thanks for the update. There is a lot here!
static
functions always mess me up.{@inheritdoc}
for thegetEntityCountsRollback()
methods.Adding the base class is a big help. I agree that we can postpone further work to a follow-up issue. There is still a lot of code that is duplicated in the
run()
method, and I would like to move that to the base class. It should handle all the sandbox management. The important thing for now is that we have isolated the code that we know is going to change from #3151363: Double // in file paths (already fixed) and #3175953: Cleanup migrate drupal functional tests (RTBC). We can handle #146.5, #146.6 in the follow-up issue.Just one more request for the new base class:
Make the class comment a little more specific: something like "Base class for migration batch operations."
Comment #149
quietone CreditAttribution: quietone as a volunteer commented@benjifisher, thanks.
Nice, only comment changes!
146.11. Yes, of course. Just got confused, I am so used to seeing inheritdoc on the getEntityCount* methods I didn't even notice.
148. Thanks. I didn't like that class comment either.
Added followup. #3191590: [PP-1] Refactor Migrate Drupal UI batch classes.
And added another screenshot, so all the screenshots are up to date now.
Comment #150
benjifisherStill NW for #146.2, #146.3. Those look like unrelated bug fixes, but maybe there is a reason to include them here.
Thanks for creating the follow-up issue.
That should be "... per entity type ...".
Comment #151
quietone CreditAttribution: quietone as a volunteer commented146.2 The change in MigrateExecutable was added in #88 and is not needed.
146.3 The change in EntityConfigBase was added in #73 and tests fail if it is not included. I am pretty sure it has to do with dependencies. For d6 it fails when rolling back d6_profile_field_option_translation but I am just not seeing what dependency is incorrect. However, even with that I do think that testing the entity exists before deleting it is a good practice and this change should stay.
This patch removes the change to MigrateExecutable and updates the comments as per #150.
Comment #152
benjifisherThanks for reverting the change pointed out in #146.2 (
MigrateExecutable
). I am updating the Proposed resolution to mention the change pointed out in #146.3:Can we make it simply
if ($this->storage->load($entity_id))
? If so, then break the long line while you are at it.Either way, this change looks completely safe. I guess the test failure is shown in
Upgrade7Test
in the tests for #71. If we want to add an issue to investigate the dependency problem, that is a good place to start. Even if we fix that, it is easy for someone working on a site upgrade to delete individual content items, then do a rollback. We do not want a PHP error when that happens, so a check forNULL
here is a good idea.The last things we need to do are the documentation updates. Is the CR up to date (including screenshots)? I am updating the issue summary since we are doing #2947498: Document Migrate Drupal UI rollbacks as part of this issue. Can we add some proposed text for Upgrade using web browser to a comment or the issue summary?
Comment #153
benjifisherComment #154
quietone CreditAttribution: quietone as a volunteer commentedI updated the CR with a new screenshot and a text change from 'button' to 'option'.
Suggestion for the doc, update the Start paragraph from
If an upgrade was not done then the Upgrade page provides information about the preparation steps that should be done before continuing with the upgrade. However, if an upgrade was done then you are asked if you want to import new configuration and content. If you continue, for either of these situations, you are then asked to define the source site.
to
If an upgrade was not done then the Upgrade page provides information about the preparation steps that should be done before continuing with the upgrade. However, if an upgrade was done then you are asked if you want to import new configuration and content or to rollback the upgrade. If you continue, for any of these situations, you are then asked to define the source site.
Comment #155
quietone CreditAttribution: quietone as a volunteer commentedFollow up created to figure out what is suspected to be a dependency problem, #3191782: Fix dependency in d6 user profile translation migrations When that happens the error is
152.1 It is reasonable to think that the error from the tests in #71 would should the error generated by the dependency problem but it does not. I am pretty sure that error was caused by #2978320: [backport] rdf comment storage load should not load NULL comments. The error message here must have appeared locally and fixed. I guess I could add a fail patch, but I don't think that is necessary because testing that an entity exists before deleting it is a sensible thing to do.
I think that is everything, back to NR.
Comment #156
benjifisher!is_null()
. Can we?Comment #157
quietone CreditAttribution: quietone as a volunteer commented156.1 Yes. Is this better?
156.2 Suggested text:
If an upgrade was not done then the Upgrade page provides information about the preparation steps that should be done before continuing with the upgrade. However, if an upgrade was done then you are asked if you want to import new configuration and content or to rollback the upgrade. If you continue, for any of these situations, you are then asked to define the source site.
A rollback will remove all the content that was added to the site by an upgrade or an incremental upgrade but not all configuration. Configuration, such as fields and their settings will be removed but configuration such as the basic site settings are not restored to their previous value.
Comment #158
benjifisherThanks for the update for #156.1.
The proposed text in #157 is a good start. I think this issue is ready!
Comment #159
adityasingh CreditAttribution: adityasingh as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedPatch at #157 is conflicting with issue MigrateUpgradeImportBatch does not use source_private_file_path & source_base_path correctly, making it impossible to have public & private files in separate locations commit ID 42aa2b1.
This is why I believe #157 is failing and needs some work with respect to the conflicting commit, adding patch for this kindly review.
Comment #160
adityasingh CreditAttribution: adityasingh as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #161
quietone CreditAttribution: quietone as a volunteer commentedThanks for the reroll.
This part of the diff looks wrong. There is a change that got lost in the reroll. MigrateUpgradeImportBatch should be using the new configure method that is in the new Base class.,
$configuration = static::configure($config, $migration_id);
Here is the excerpt from the patch in #157 showing the change that needs to be restored.
This is what was lost.
Comment #162
abhisekmazumdarAdded the missed out part. Kindly review.
Comment #163
huzookaMaybe this is also related: #3186449: Rolling back a migration implementing MigrationWithFollowUpInterface does not clear the generated follow up migrations from the cache..
We had issues with the
d7_entity_reference_translation
migrations when we tried to roll back migrations.Our workaround was:
We wrote a smart
migration_lookup
plugin.migration_lookup
plugin indefineValueProcessPipeline()
.d7_entity_reference_translation
migrations.Comment #164
quietone CreditAttribution: quietone as a volunteer commented@huzooka, I fail to see the connection between the entity reference migrations and rolling back via the UI. The problems encountered in this patch concerned RDF and orphan comments.
Comment #166
huzooka@quietone,
If you roll back node migrations, including node types, then the source plugin used by etr migrations will throw an exception.
Comment #167
benjifisher@adityasingh: I already pointed out the conflict with #2925899: MigrateUpgradeImportBatch does not use source_private_file_path & source_base_path correctly, making it impossible to have public & private files in separate locations in #146.7.
Comment #168
quietone CreditAttribution: quietone as a volunteer commentedThis was discussed at the migrate meeting so lets get this passing tests. So rerolling. And I think my review in #161 was incorrect. Apologies.
Comment #169
huzookaI'm almost sure this is a workaround for #3187415: Module settings translation migrations should depend on the default settings migration. Has anyone ever checked what are the configs that make this necessary?
It would be nice to test a re-import after this rollback.
Comment #170
quietone CreditAttribution: quietone as a volunteer commented160.1 For d6 these config entities are null when the rollback attempts to delete them. My first guess is dependency problem.
169.2 I added that but I will be surprised it the entity count assertions pass.
166. @huzooka, can you provides steps to reproduce?
Also, I checked and the followup migrations are not rolled back. :-(
Instead of providing rollback through the UI we need to consider not doing this and have people reinstall, or reload a fresh db. If this is wanted I would like to postpone it on #3082211: Migrate UI upgrade tests should provide the complete log and #3084477: Bulk output entity count errors from migrate_drupal_ui tests.
Comment #171
quietone CreditAttribution: quietone as a volunteer commented#169.1 - I forgot I made an issue for that, #3191782: Fix dependency in d6 user profile translation migrations
Comment #173
quietone CreditAttribution: quietone as a volunteer commentedDiscussed at #3203113: [meeting] Migrate Meeting 2021-03-11 and there is support for marking this as won't fix. As of this writing benjifisher, heddn and myself participated in the discussion.
In summary, the reasons are:
Is there any objection to marking this won't fix?
Comment #174
quietone CreditAttribution: quietone as a volunteer commentedComment #175
xjmThanks @quietone. Since this affects the product aspects of Migrate as well as the features available to improve data integrity, I'm tagging for Product and Release Manager review.
Comment #176
catchSo for me personally, still need to discuss this more with @xjm too:
Even though I use drush to run migrations, I prefer re-installing and re-migrating to using rollback, because I know I'm doing exactly the same thing each time. It potentially means a lot longer to run commands, but it's more reliable and can be running in the background. Dealing with rollback means I have to wait for the rollback to finish before re-migrating, and if something goes wrong there are more possible reasons.
If we did offer rollback through the UI, is this going to just be rolling back an entire migration/set of migrations, or would we also offer options like specifying a range or specific entities to rollback?
If it's the latter, we can't expect site admins to specify entity IDs manually like the drush command does, so it starts to look more like VBO (although not sure what VBO would look like for this). If we don't offer those options, then there's not that much difference from requiring that people reinstall and re-migrate - I think there's an issue elsewhere to offer a reinstall button that we could revive though.
Comment #177
quietone CreditAttribution: quietone as a volunteer commentedYes. It will rollback all the discovered migrations.
Comment #178
webchickHm. Migrate UI went stable in #2905491: Mark Migrate Drupal UI as stable (thanks for the archeology, @Gábor Hojtsy! :D) so we're good there in terms of this being a stable blocker.
I completely understand the Migrate team not wanting to work on this feature, due to its complexity and user impact (or lack thereof), and the desire to focus the team's effort elsewhere that's more impactful... that's perfectly fine.
But I don't quite understand why we'd "won't fix" what seems like a perfectly reasonable feature request here. Like, if an enterprising contributor comes along and donates time to bring it home, or Acquia someday decides to fully open source Acquia Migrate Accelerate, which has this feature... I don't think we'd want to say we explicitly don't want the feature to roll back migrations..? The UI matching what the API can do seems desirable, as a general rule?
Comment #179
xjmBased on #178, maybe we just downgrade this to normal? The scope is large but it sounds like the priority is not so much.
Comment #180
quietone CreditAttribution: quietone as a volunteer commentedHow does that handle config migrations which do not rollback to the state before the upgrade was run?
Comment #181
webchickFair, it does not. :) But even still, rolling back content migrations is quite a useful feature to have.
Trying the "normal" downgrade on for size.
Comment #182
quietone CreditAttribution: quietone as a volunteer commentedIf rolling back content is useful, then let's change this to do just that, to rollback only content. That will be easier to do (with the possible exception of blocks) and definitely easier to explain.
Comment #183
benjifisherIt has been almost two weeks since the last comment. I will update the issue summary as suggested, changing the scope of the issue so that it only rolls back the content migrations.
Maybe the hardest part will be documenting what that means.
I think it makes a lot of sense to separate configuration migrations from content migrations. I usually run configuration migrations early, then start tracking configuration as usual and never run those migrations again. All the iteration is on the content migrations. I think I feel the need for a follow-up issue ...
Comment #184
marvil07 CreditAttribution: marvil07 at Adapt commentedIt is confusing at times to refer to
migrate_drupal_ui
as Migrate UI.When I think about Migrate UI I think on a general UI for
migrate
, but this issue is aboutmigrate_drupal_ui
, which is specific for Drupal to Drupal migrations.Just making a note and changing the title to avoid some confusion.
Comment #185
quietone CreditAttribution: quietone as a volunteer commentedThe patch needed a reroll. Not running tests as they will fail anyway, just posting it for reference.
Comment #186
quietone CreditAttribution: quietone as a volunteer commentedThis works locally to rollback content and re-import it. Again, not running test because they will fail.
This changes the incremental form so that what an upgrade is performed an option to Rollback is given. Then, once the rollback has run and one returns to the incremental form, via /upgrade, the option to Rollback is replaced with an option to upgrade content.
Comment #187
quietone CreditAttribution: quietone as a volunteer commentedAdding a new test. The d6 tests fails but it is tool late to investigate that now.
Comment #189
KapilV CreditAttribution: KapilV as a volunteer and at Innoraft for Drupal Association commentedComment #190
KapilV CreditAttribution: KapilV as a volunteer and at Innoraft for Drupal Association commentedComment #191
KapilV CreditAttribution: KapilV as a volunteer and at Innoraft for Drupal Association commentedComment #192
quietone CreditAttribution: quietone as a volunteer commented@kapilkumar0324, when you create a patch it is helpful to comment on the changes you have made an why you have made them. That makes it so much easier to review. Looking at the interdiff it looks like you are trying to get the tests to pass. In this case, that is not the next step, which my comment in #187 was trying to express. That first investigation needs to be done to understand why the entity counts have changed and document it.
Comment #193
KapilV CreditAttribution: KapilV as a volunteer and at Innoraft for Drupal Association commented@quietone thank you for the suggestion.
Comment #199
sahil.goyal CreditAttribution: sahil.goyal as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedreroll the patch for the current version so it is now been compatible and attaching the Reroll patch for the same.
Comment #200
_utsavsharma CreditAttribution: _utsavsharma at OpenSense Labs for DrupalFit commentedFixed CCF for #200.
Please review.
Comment #201
steinmb CreditAttribution: steinmb as a volunteer and at University Of Bergen commentedThank you for contributing and keeping this issue alive:
* Are these a re-roll of #187?
* Please try to include a interdiff