Hello all, it’s time for the weekly migration subsystem meeting. The meeting will take place in slack in various threads
This meeting:
➤ Is for core migrate maintainers and developers and anybody else in the community with an interest in migrations
➤ Usually happens every Thursday and alternates between 1400 and 2100 UTC.
➤ Is done on the #migration channel in Drupal Slack (see www.drupal.org/slack for information).
➤ Happens in threads, which you can follow to be notified of new replies even if you don’t comment in the thread. You may also join the meeting later and participate asynchronously!
➤ Has a public agenda anyone can add to. See the parent issue for an idea of the typical agenda.
➤*Transcript will be exported and posted* to the agenda issue. For anonymous comments, start with a :bust_in_silhouette: emoji. To take a comment or thread off the record, start with a :no_entry_sign: emoji.

Core migration issues

Next video meeting

2021-07-01 - The hope is that most or all of the maintainers will attend. We will try to focus on longer-term goals than in the weekly meeting.

Agenda Items

Add your items here.

0️⃣ Who is here today? What is your favorite kind of apple?

Kunal Kapoor Hi kunalkapoor, from India :wave: (edited)
marvil07 o/ :apple:
benjifisher Welcome @Kunal Kapoor! Is this your first time at this meeting? (edited)
Kunal Kapoor @benjifisher yup this is my first time
gaurav mahlawat Hello :wave: Gauravmahlawat from India.
benjifisher I am Benji Fisher, from Massachusetts in  the US. I like tart apples: when I bite into one, I want it to bite back. Jonathan is one of my favorite varieties.
benjifisher @Kunal Kapoor. what do you hope to get out of today's meeting? Are you looking for ways to contribute?
Kunal Kapoor yes
Matroskeen Hi :wave: I am Ivan from Lutsk, Ukraine.My favorite apples are the ones baked inside apple pie :pie:
anmolgoyal74 Hi.. anmol from :flag-in:.
alison Alison here, newly out of Rochester, NY (I was in another part of upstate NY before haha)I love tart apples and am willing to sacrifice crunch for flavor, therefore my favorite are Macintosh -- but obviously I prefer early in the season when they're crunchy :apple:
jibran Hi! Jibran, AU. Red sweet apple.
quietone Vicki, from NZ. Royal Gala.

1️⃣ What should we talk about today? Suggest topics here and I will add threads. I will also check for comments on the issue for today's meeting.

marvil07 migrate_tools/drush
Matroskeen I just have a question - do we have any API to ignore certain properties during migration with --update flag?I’m asking because of this issue: [#2955445]I was thinking about it a little bit and I’m not sure that this is a problem of process plugin. (edited)
marvil07 there is :slightly_smiling_face:
marvil07 (me looking for it)
marvil07 @Matroskeen destination.overwrite_properties
marvil07 See Drupal\migrate\Plugin\migrate\destination\EntityContentBase, so it works with that destination
Matroskeen Thanks, I’ll take a look!
benjifisher Please discuss this topic in 1️⃣0️⃣.

2️⃣ Action items. To be added later.

benjifisher Following up on last week's items, I think we did pretty well.Now RTBC: #2571235: [regression] Roles should depend on objects that are building the granted permissions. I have been reviewing, and @alexpott has made several updates in the last week.
benjifisher NR: #3063856: Add ability to view migrate_message table data. @benjifisher
benjifisher Comment and/or review: #3199727: Create plugin for recursive YAML discovery. @heddn
benjifisher Manual testing: #3193189: Get only translations for localized vocabularies d6/TermLocalizedTranslation.php. @Kunal Kapoor
benjifisher Various problems when the database key is not 'migrate'. One is #3123950: 'Field discovery failed for Drupal core version 7' errors if migration source database key is not 'migrate'. Volunteer needed.

3️⃣ Statistics

benjifisher Fixed since last week's meeting: 1 (not counting the issue for the meeting).
benjifisher RTBC: 7, 2 of which are Major.
benjifisher NR: 33, including 3 Major and 2 that have not been updated in more than three months.
benjifisher todo: update the spreadsheet https://docs.google.com/spreadsheets/d/1o0Rjlc1vnnLP5bM5P-SMMyGzqn7258hi...
Matroskeen The sheet was updated. The “Needs review” trend is going up :)
benjifisher thx

4️⃣ How can I help? Comment in this thread if you are looking for ways to help. Give us some idea of what you would like to do: documentation, code review, testing, project management, ...

benjifisher @Kunal Kapoor, this is a good thread if you are looking for ways to contribute. Can you answer the questions at the start of the thread?
Kunal Kapoor i can do the documentation part or the code testing part
benjifisher On 9️⃣ I mentioned that, even though the issue is marked RTBC, it needs some testing. Does that seem like something you could do?
benjifisher You would have to set up a D6 site, install some translation modules, generate a database backup. Then use that in a migration to a new  D9 site.
benjifisher Most of those steps are things you will have to do for testing any migrate_drupal issue. People on this channel can give you help getting set up.
Kunal Kapoor ok :+1:

5️⃣ errors if migration source database key is not 'migrate'

benjifisher #3123950: 'Field discovery failed for Drupal core version 7' errors if migration source database key is not 'migrate'
benjifisher I have put up with various incarnations of this problem for a long time. There is at least one related issue. It would be good to track it down once and for all. @huzooka requested that we discuss it this week.
huzooka My suggestions:core should document this at a very visible 'space'.Migrate Upgrate should refer to the doc in core AND it should restore the previous migrate fallback state key instead of blindly deleting its value.Migrate Tools should refer to the doc in core.(edited)
marvil07 I think I only foudn a problem similar to this once, while using migrate_upgrade, but it is likely specific to that module, since I never really found it again.
benjifisher I was thinking generally: there are several problems when the key is not 'migrate'. There might be more than one piece of code that makes this assumption, but it might just be in migrate_plus. If so, then the problems could show up in any module that depends on it.
benjifisher @huzooka, can you be more specific about the documentation you want to add? If you have a comment on the issue, maybe you can copy it here.
huzooka there are several problems when the key is not 'migrate'. There might be more than one piece of code that makes this assumption@benjifisher Based on my experience, this bad assumption is very rare. E.g Core, Paragraphs, Media Migration are definitely okay from this point of view. (edited)
huzooka From here: #3180710: [migrate_upgrade] Errors when running migrate:status in Drush#comment-14075072Migration source plugins extending Drupal\migrate\Plugin\migrate\source\SqlBase are finding their source database with their getDatabase() method (almost all Media Migration source plugin extends DrupalSqlBase, which extends SqlBase).If you check how SqlBase::getDatabase() works, you will notice that we have some options for defining what source database should be used by the actual plugin instance. Notice that one option is specifying a Drupal State key migrate.fallback_state_key. If none of the if elseif statements are matched, then SqlBase::setupDatabase() gets called with an empty array, which will try to get the DB connection with migrate key and with default target.The issueWhen you export the migrations with Migrate Upgrade by specifying the source database with the --legacy-db-key, Migrate Upgrade sets the the migrate.fallback_state_key fallback key. This ensures that all of the migrations are generated based on the given source database. But right before its migrate:upgrade command finishes, it deletes this state key!And this is why we all see these errors if we use a different source connection key than migrate.The solutionYou have to (re-)define the source connection state key (and even the value of that key) after you used drush migrate:upgrade, right before you want to do anything with the migrations:drush php:eval \ "\Drupal::state()->set('source_db_connection', [ 'key' => [db-key-of-source-site], 'target' => 'default', ]);"drush php:eval \ "\Drupal::state()->set('migrate.fallback_state_key', 'source_db_connection');"
huzooka ^^ the linked Media Migration issue comment contains links to the referred code as well
benjifisher Wouldn't it be simpler if migrate_upgrade did not delete the state key?
quietone My thinking exactly. Why is the state key removed?The removal was added in #2704721: Restore configure-only option and I don't see any discussion there about the key.
huzooka That is not so simple
huzooka What happens if a user exports the migrations, and after a reinstall (or after deploying them to an another Drupal instance) he/she sees the same message?(States can be emptied and aren't deployable) (edited)
huzooka The options of SqlBase::getDatabase()   must be documented somewhere what is easy to find.
huzooka That is the solution.
huzooka (And Migrate Upgrade should retain the original key - or/and even not forcing its users specify source connection in Drush command line if the source database from SqlBase::getDatabase() is reachable) (edited)
huzooka For Migrate Upgrade, adding the source connection's target and key to migrations using SqlBase plugins also an option
benjifisher Migrate Upgrade might even store the key in config as well as state, then add a little code to pass that config to getDatabase(). Either directly or by setting state from config.
huzooka PLEASE document the and don't change the underlying code! (edited)
huzooka PLEASE!
huzooka Why is this soo hard?
benjifisher Perhaps you are assuming that we have taken the trouble to read all the comment on the issue. I think that is more than you should assume when bringing something up in the weekly meeting.If we do change the code, then we will do it in a BC way, by adding new options or new commands. We can discuss that on an issue when we start to work on it.
benjifisher 6️⃣ Views migration from Drupal 7 to Drupal 9

6️⃣ Views migration from Drupal 7 to Drupal 9

benjifisher #3211276: Views migration from Drupal 7 to Drupal 9
benjifisher I think @greg-boggs commented on Views migration in this channel in the last week (or two?). The current MR on that issue ^ needs a lot of work.
huzooka +1 on building this in a contrib for first
greg-boggs The core issue is a bit sidetracked rewriting the code for more better code  before it's close to works. But, it's the same person working in both places. So, hopefully he doesn't give up. It's on my list to keep reviewing his module, but I had to stop working on it to start clicking in views manually in my project :slightly_smiling_face: (edited)
greg-boggs I do think it's good to be supportive in the core issue. If he knows he will eventually get some core credit if we completes the feature, it should help motivate him to work on it because it's a super difficult migration to write, and he's already written some pretty tough stuff.

7️⃣ Create plugin for recursive YAML discovery

benjifisher #3199727: Create plugin for recursive YAML discovery
benjifisher @Matroskeen: IIRC, the last time we discussed this, I suggested creating this as a contrib module. I am not against adding it to core, but I want to see how popular it is before we do. I do not think there is any structural reason why it would be easier in core than in contrib.
Matroskeen I recall, but @heddn mentioned:“I think we want to see this happen in core. Plugin discovery isn’t something I want to get into with contrib.”It gave me some hope that it could be a part of the core. (edited)
benjifisher @heddn: can you at least comment on the issue? If you think this is a good thing to have in core, then a review would be even better.
Matroskeen Just to clarify: there are 2 issues so far:creating a plugin;use this plugin for migrations;We are stuck at the first item. (edited)
heddn @benjifisher @Matroskeen from my understanding of the request, we wanted to traverse down into sub folders to find migration yaml files. did I mis understand?
heddn that isn't a plugin or anything. its about adjusting how we find files in the migration folder
benjifisher I think that would be the second issue (postponed). The first issue is about providing a generic discovery plugin. @Matroskeen, do I have that right?
Matroskeen Yes, that’s correct.I call it plugin, because there are multiple plugins for discovery.
benjifisher IIUC, core has a plugin for discovering plugins from directory/*.yml and the issue proposes something similar that would look in directory/*/.yml, with some include/exclude options, maybe some other configuration.
heddn directory/*/.yml is what I was thinking we should do core. but not exclude/include
benjifisher I meant to say directory/**/.yml. (I blame Slack auto-formatting.)If include/exclude turns out to be a useful feature, then it is extra work if that has to be added by a contrib module.That is one reason to start with a contrib module. Let people use it and find out whether include/exclude or other features are actually useful.
Matroskeen For the migrations discovery, we need exclude to ignore migration/state/*.yml files. And I agree that it would be some extra work if it’ll be cut out from core version.I didn’t like contrib approach that much, because the recursive discovery is a generic thing, not migration-specific.At this point, I don’t mind creating a contrib module, for example “Migrate Recursive Discovery”.Please let me know if you have other ideas for module name :slightly_smiling_face: (edited)

8️⃣ Migrate Tools and Drush

benjifisher @marvil07, can you supply a link? And a status update?
marvil07 https://gitlab.com/drupalspoons/migrate_tools/-/issues/118
marvil07 Status updateThe first change related to adding/re-implementing a migrate_tools option inside drush core got merged!One extra nice thing that we gain on the drush core implementation that I think I have not mentioned before is test coverage for commands.I am starting to work locally on a 6.x branch to change the migrate_tools specifics on top of drush core migrate commands.
benjifisher Thanks for working on this. When you get to the NR stage, feel free to post in this channel. We all have a lot of things to do, so this can get lost even though it is really important.
marvil07 will do

9️⃣ Get only translations for localized vocabularies d6/TermLocalizedTranslation.php

benjifisher #3193189: Get only translations for localized vocabularies d6/TermLocalizedTranslation.php
benjifisher @quietone requested a review of this issue, and it is now RTBC. I think it should get some manual testing as well.I had a look at it, and the fix is small, but it involves a lot of things that I am not familiar with, like the D6 translation system (i18n modules).
jibran I rtbc it. Fix looked same as d7 one.
quietone Yes, being the same is true for just about everything in the d6/d7 i18 translation issues.

1️⃣0️⃣ Modify migrations when updating

benjifisher @Matroskeen says this came up on #2955445: make_unique_entity_field does not handle entity update
benjifisher I think this is already possible in the process stage. At least if what you want to do is skip some properties.Use entity_lookup to see whether the destination entity already exists.For the property you want to skip, start with the skip_on_value plugin, checking the destination property from (1).Usually, the process pipeline passes the result of one process plugin to the next. But you can also ignore that value by supplying source to the next step in the pipeline.
benjifisher Of course, you can also have two different migrations. Run the initial one without the --update option and then run the second one with that option.
Matroskeen Thanks, I’ll check with my teammate (who is the author of this issue)
marvil07 destination.overwrite_properties from  Drupal\migrate\Plugin\migrate\destination\EntityContentBase, is also useful (edited)
Matroskeen Thanks for your answers!

1️⃣1️⃣ Wrap up

benjifisher Thanks for participating! I already updated 2️⃣. Please continue to add comments in the threads. In 1-7 days, we will post a transcript for today's meeting.
marvil07 :thankful:

Participants:

Kunal Kapoor, marvil07, benjifisher, gaurav mahlawat, Matroskeen, anmolgoyal74, alison, jibran, quietone, huzooka, greg-boggs, heddn

Comments

benjifisher created an issue. See original summary.

benjifisher’s picture

quietone’s picture

Nice to see a views migration issue #3211276: Views migration from Drupal 7 to Drupal 9 . The source plugin is doing a lot of work which looks like should be in process plugins and it doesn't have any tests yet. My question is, should this continue in contrib for a while longer?

matroskeen’s picture

Can we discuss again #3199727: Create plugin for recursive YAML discovery and #3195568: [PP-1] Support recursive discovery for migration plugins for a bit?

@andypost said it should be outside of the core here: https://www.drupal.org/project/drupal/issues/3199727#comment-14008185
@heddn said he wants to see this in core here: https://www.drupal.org/project/drupal/issues/3195568#comment-14076230

@quietone, @benjifisher it seems you didn't have a strong opinion about this feature.
What do you think? Should we ask more people?

quietone credited heddn.

quietone credited huzooka.

quietone credited jibran.

quietone credited marvil07.

quietone’s picture

Issue summary: View changes
quietone’s picture

Status: Active » Needs review
quietone’s picture

Add credit.

quietone’s picture

Try again

quietone’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.