Migrate files between ActiveStorage Providers with ease

There are several ways to migrate files between ActiveStorage Provider. I'm gonna use the mirroring way. First setup your new ActiveStorage provider. Let's say for the sake of this post we're going to migrate from local Disk based storage to S3.

Upload ActiveStorage files to nested S3 path

ActiveStorage doesn't support any kind of nesting inside S3 bucket (as of Rails v6.0). But without nesting, managing Multi Tenant application will be just plain hard. Specially is you use different database/schema per tenant.