Skip to content

Instantly share code, notes, and snippets.

Last active January 31, 2017 16:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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 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 -
Copy link

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