Skip to content

Instantly share code, notes, and snippets.

@ianlintner-wf
Last active January 31, 2017 16:26
Show Gist options
  • Save ianlintner-wf/0ac5221397407f3474176aba41716a2d to your computer and use it in GitHub Desktop.
Save ianlintner-wf/0ac5221397407f3474176aba41716a2d to your computer and use it in GitHub Desktop.
Drush Migrate a Drupal Site Variable Between Sites in JSON. #Drush #vget #vset #json #pipe #Drupal #export #import
# Drush script to port specific variables. Can be used with other bash scripts for looping/migration.
# This is a first version and could be cleaned up and use ENVs
# $1 source site alias
# $2 target site alias
# $3 variable name
# drush @alias.source vget --format=json --exact custom_module_variable | drush @alias.target vset --format=json --exact custom_module_variable -
# Remeber there is a "-" at the end of the vset command!
drush $1 vget --format=json --exact $3 | drush $2 vset --format=json --exact $3 -
@ianlintner-wf
Copy link
Author

This script exports a variable from Drupal site via drush in a json format and imports it into another. Script to speed up Drupal deploys & migration using drush.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment