Migrating a site with 8,000 images from an old CMS to WordPress. The images are stored on the filesystem with a flat structure (all in one directory) and referenced by absolute paths in the content HTML.
What is the best approach to get these into the WordPress media library with proper attachment records?
do not try to import them through the WordPress admin UI. Use WP-CLI’s wp media import command. It handles the upload, generates thumbnails, and creates the attachment post records.
For 8,000 images, script it in a loop and log the mapping between old paths and new WordPress URLs. You will need that mapping to find-and-replace the image references in your content HTML.