When I’m not making stuff, I’m often in Archival Mode. This means that I’m working on things to better display the stuff I made in either a private or public space.

Lately, I’ve been updating #NebyooMusic, https://music.nebyoolae.com, to use a sub-theme based on #Bootstrap5, and so I’ve been going through all my templates and CSS to make things work again.

Ideally, I’d change all the #Drupal Files to Media entities, but haven’t found a way to do it for 600+ items.

Nebyoolae Music | Home

The home for all music created by the musician Nebyoolae.

Nebyoolae Music
@nebyoolae I may have some code that will help you with that, if it's a Drupal9/10 site. I wrote a little migration module that creates Media entities from managed files. It depends on the Drupal 8+ migration contrib module. My code is at https://github.com/toddviola/file2media
GitHub - toddviola/file2media: A little Drupal module that provides migrations to create core Media entities from existing Drupal-managed files. Useful after migrating from Wordpress.

A little Drupal module that provides migrations to create core Media entities from existing Drupal-managed files. Useful after migrating from Wordpress. - GitHub - toddviola/file2media: A little Dr...

GitHub

@toddviola Thanks for reaching out. My site is Drupal 9, so this might be useful.

A couple things, tho: I tried adding your module to my site, but it doesn't show up in Extend. Also, I only need to convert audio files, and there seems to only be support for Files and Images.

@toddviola I also just realized something about my audio files and the way I'm using them in Drupal: I manually uploaded them to a specific directory, and then added links to them in my content type. So...there aren't any managed files, just links to local files on the server.

Yikes. I think I'm going to have to manually re-add all these 600+ audio files as Media entities...by hand. Sigh.

@nebyoolae Good luck. I only had to migrate images and PDF documents, so I didn't include a migration for audio files. I'm sure there's a way to write a migration plugin for general use, but I didn't need that. Sorry to hear about the manual uploads. It looks like this Media Library Importer module might offer you a solution for that. I've never tried it. https://www.drupal.org/project/media_library_importer
Media Library Importer

Media Library Importer A module to import media files from public directory into media library. There are a lot of tutorials on how to import file entities into media galleries using migration tools.

Drupal.org