Articles from 2022

Stripping Inline PHP From Drupal Text Fields During Migration

I'm currently migrating a Drupal 7 site, but the (somewhat naughty) PHP code embedded into some of the text fields isn't being removed by the Drupal 9 text format: it's being rendered as plain text, which is a potential massive security hole.

Had me stumped, as I was trying to avoid Regex, which isn't particularly reliable for dealing with HTML; XPath was also a dead end... essentially need to remove the <?php and ?> tags plus any code between them.

Migrating Content from Drupal 8/9 to Drupal 9 - Files

content_entity plugin only works if migrating site within an existing Drupal 8/9 site. If you need to use an external database from a D8/D9 site, you'll need the https://www.drupal.org/project/migrate_drupal_d8 module

Here's an example of migrating files (prior to migrating media items)