Another set of confused questions from a desperate newbie, this time about importing data from an xml file into a D8 project.
I have a map built with Google MyMaps containing about 100 placemarks and about 500 images attached to them. Google kindly offers to export the map contents into a "kml" file which is basically rather straightforward xml.
The import of this particular file is supposed to be a one-off job, but there may be other kml files in the future which is the only reason I have not given up yet - in the time I have already spent trying to figure out migrations (and I'm not even nearly there yet) I could have easily entered all my data by hand ten times over ;)
There is a lot of disjointed info about migrations here and there but most of it is written in some language all the words of which seem to be English but the sense almost completely escapes someone who is not intimately familiar with Drupal or YAML :(

So, the questions are:

1. Am I correct in assuming that creating a custom module, manually composing and running a migration.blablabla.yml is THE way to get my data into the database, EVEN though it's a one-off job, EVEN though I don't care about data duplication etc, EVEN though I am not at all interested in developing tests other than just looking at the results with my own eyes etc etc?

2. One of the xml fields in my import file (description) is a long HTML text that I would like to dissect into several meaningful fields to store in my Drupal node. The text follows the following pattern (square brackets are not part of the actual field contents but are there to show what I need to extract):

<description>[unneeded stuff]<br><br>[street address]<br>[architect name], [year]<br>[unneeded stuff]</description>

I looked at all the process plugins mentioned anywhere and it kind of seems that the explode plugin might do it for me in a couple of passes (assuming the delimiter can be longer than one character - like <br><br> otherwise I'm cooked) but even after reading all the documentation available I still have no clue how do I access a specific member of an "array" that the explode plugin is supposed to produce... Could any kind soul enlighten me in plain English please?

3. Am I correct in assuming that the only way to see how a plugin actually works is to compose a complete migration and try running it? Is there any way to "play" with a plugin feeding it some test data by hand and looking what comes out of it? To pass an xml file through the sequence of process plugings without storing stuff in the database, just look what comes out of the plugins?

I can't believe Drupal can be THAT undebuggable - in my 30+ years experience developing all kinds of software from writing Macroassembler code for PDP-11 (I wonder how many people here even have any idea of what I am talking about:) to designing complex core banking software with a 4GL and relational databases I have never encountered an environment so difficult to grasp as the Drupal migration module and no visible way to "play" with its components one by one to better understand what they do exactly. Please tell me I am wrong here.

Would really appreciate any advice (and encouragement!) before I give up ;)

Comments

Jaypan’s picture

Would really appreciate any advice (and encouragement!) before I give up ;)

I can't help with the advice, as I haven't worked with Migrate in Drupal 8.

So only with encouragement - keep at it! The more you use it, the more you'll get it.

jclaussen’s picture

marassa’s picture

The problem is:

8.x
It's not ready yet. We're hoping it will be ready soon.

But I'm gonna check out the dev version anyway - maybe what I need works already.