I tried first to fix migration off S3, and was told after I had completed using my own migration as a test bed for the code i was writing that I had taken completely the wrong approach. This assertion was supported by data corruption in my (large) instance that I migrated off S3 and into local files. Relatively recently, I ended up fixing up broken data in the database by hand, and I don’t have an expectation that I’m done cleaning up after my attempt.
If I were going to start a migration off of S3 onto my own storage today, I would spin up a minio container next to discourse, use minio-client to copy from S3 to my minio container, reconfigure discourse for the new “S3” location of my local minio, and then posts:remap
or rebake all posts to serve “S3” from my minio container.
Here’s an example of how posts:remap
should work here. I have a sense that there’s a better example somewhere here, but this should be enough to get started.