I think the easiest way is to enable the hidden setting that downloads all the S3 files to a backup at the console (you’ll get to search here or look in the source), change to spaces, restore the backup, rebuild the container.
Remember to turn off the setting that downloads the images or you’ll download and upload all your uploads at every backup!
I’ve been wanting to figure this out for years, and my tests keep failing, I think for edge case reasons. Let me know if that works. You can test it out by restoring to a test site.