I currently have a bucket where all my images are hosted and stored. I currently display them by simply using URLs that link to the images (i.e https://[bucketName].s3.amazonaws.com/[imageName]).
I currently have over 22k photos in the bucket but I want migrate them over to the Drupal database.
This was how I planned on resolving this:
- I was thinking of trying to find an API that would get a list of all the objects in my bucket.
- Then after getting the list off all the objects, use PHP's
file_get_contents()function to get the image itself
- Then programmatically create the Media type after each URL request, by following what I saw here, Programmatically create media file or possibly doing this Create file/media
Is this a proper approach? Or is there a better way for me to approach this?