Right. But the obvious solution is to just not do that. Create a template and base production/staging off it, then use that template. Or use the same bootstrap/migration process to create the template as you do staging.
Regular tests shouldn’t assume access to staging/prod, anyway.