When I migrated my blog to Drupal 10 back in September, one of the things that got left out was migrating the collection of just over 300 sounds that I’d posted over the years.
I sat out to do this today, and they’re back in place here, everything from me at 6 months old to a remixed Stuart McLean to versions of The Island Hymn to a Bruce Guthro bootleg.
I’ve also brought the podcast feed of sounds back to life.
This was a ChatGPT-assisted coding job, with the prompt:
I have a legacy Drupal 7 website. I have migrated it to Drupal 10 using the “migrate” modules. One of the content types, “sound”, migrated the title and body fields, but not an attached Media field, which points to a managed file, and MP3, that is the sound attached to each node.
I want to reattach the MP3 files to the nodes in Drupal 10. The files are already migrated into managed files in Drupal 10, so I don’t need to actually migrate the files, I just need to attach them to the Drupal 10 nodes.
I need some code to do this.
I was returned a PHP script that needed some mild editing only, and that, blamo, did exactly what I asked when I ran it, saving me a lot of thrashing around, and confirming that I got out of the programming profession at the right time.
Add new comment