Deleting Tenant media in SANDBOX environments

Hi,

When we create a new sandbox environment from production it takes all of our tenantmedia across with it resulting in prod being 190Gb and each sandbox being 190Gb…..We don’t need this tenantmedia in our sandbox environments

Has anybody written something to remove this tenantmedia in sandbox environments?

Thanks

1 Like

Hi Steve,

Yeah, that happens a lot. When you copy production to a sandbox, it transfers everything, including all tenant media, so the size remains the same.

There’s no switch to skip media during the copy, but a common workaround is to clear out the Tenant Media and Tenant Media Set tables once the sandbox is created. Some people do this with a small AL report or a PowerShell script.

If you set it up as a quick cleanup step after each copy, the sandbox stays light without touching production.