To better understand how a custom content migration really works apart from all the tutorials showing how to install Drupal and press the migrate button with a 3 lines test import file or endless youtube talks loosing the focus, and to demonstrate how a very common migration hangs on the missing understanding of the migration set up first ... Can somebody please explain more structured and understandable, how a yaml file has to look like correctly (its underlying logic), to - let's say - map for migrating Drupal 7 nodes of content type "my_stories" with about 8 additional text and integer and term fields, including taxonomy terms references, images (unlimited count of images per node via file field), references to other nodes of other content type, the author, changed, created, and all the comments on the nodes? The fields have other names in D8 and the D8 installation has already all the users, fields and taxonomy groups build/set up. The different names for the fields make a custom mapping mandatory. I choose this example becasue it forces the yml file to be half self-explanatory since most explanations around are copy/paste's of other explanations and are often kind of broken, the code comments do not fit the code examples, etc.

My understanding of Drupal migrate is sadly still very basic (it's not only me, the adaption rate is low) because the yaml files and the most of the explanations in the web are confusing and not clearing things. They commonly are targeted to website-admins using standart migate settings or source import (like CSV) and are written like: do this and that without explaining the things behind. But I'm a web developer and need to understand what it does. What are the definitive requirements? Even this is often missing. Many tutorials are outdated or unclear about the simplest basic facts, maybe assuming everybody knows them.

One question which often keeps unclear in the tuts: Do I need a custom module for my custom migration mapping or not? Some tuts suddently involve a custom module without explaining why, some not. Can I migrate directly from the D7 database in this case (without changing the D8 project any further, apart from the content structure)? How to make sure that migrate will only "import" nodes, comment, etc without breaking things in D8 silently in the database, changing configs, etc.?

This (one of the better) example of mikeryan776 shows an almost complete project import of mostly everything regarding content, but its all splitted in multiple yaml files. I this required in this case? Or can I put it all in one yml file to my personal preference? This type of questions arise if the user does not understand the way it works behind the scenes or do not find the right entry point.

Is there a book or a real good webpage explaining the mapping and showing some more detailed diagrams (apart from the 3 steps diagram of "in - massage - out" kind of stupid thing) to make it clear how it works under the hood and where to start?

  • Well this is another good example of how confusing it can be, to find the right sources for learning Drupal. And with learning I don't mean for new users only. Even long-term Drupal contributors have to learn new things all the time. Drupal grows, and so the developers need to grow too. I have started a discussion about it inspired by your question, nilsun. Read here about the thoughts I have tried to formulate: redd.it/6yfo8o - I would love to read your thoughts on this too. – diqidoq Sep 6 '17 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.