I've got a Drush command that I run after copying my live db into dev that reconfigures various modules and settings that are appropriate for my development environment. For Storage API, that means marking certain containers as external.

How can I do this programatically? I guess I'm after a command like

storageapi_container_external($container_id, true);


ianthomas_uk’s picture

Project:Environment» Storage API
coreyp_1’s picture

I, too, would like to know if there is a best practice for this. Doing dev/stage/prod workflow with Storage API has turned into quite a headache that I'm not sure of a best way to solve.

Perignon’s picture

Issue summary:View changes
Status:Active» Postponed

I will be the first to tell you that doing dev->stage->test->prod is hard and nearly impossible with Storage API in some cases. The way settings have been stored in Storage API makes programmatic changes hard at the moment. This is a major feature request that I haven't even "sniffed" yet.

Basically, this module needs a lot of work to make it more developer friendly.

emmonsaz’s picture

+1 for this functionality or at least some guidance on how to use Storage API when cloning a prod site to dev/local.

Since the setting isn't in the variable table, I can't set it via settings.php, Features, Strongarm, etc. so I use our environment configuration tool to run the following command after syncing a prod database to a non-prod environment:

drush sql-query "UPDATE storage_container SET external=1 WHERE service_id='storage:s3'"

...obviously not ideal

emmonsaz’s picture

FYI: for those using https://www.drupal.org/project/habitat here's a custom module that does the same thing: https://gist.github.com/anonymous/48de54997b71cf19f107

Perignon’s picture

The problem is how the data is currently being stored in Storage API for the containers. It is a serialized array in a large VARCHAR field. So the only way to do the dev->prod will be some SQL queries, string operations, and updates.

My concern is the use of storage container credentials from Dev->prod and Prod->dev.