Skip to content

Instantly share code, notes, and snippets.

@Koronen
Created October 23, 2013 12:56
Show Gist options
  • Save Koronen/7118176 to your computer and use it in GitHub Desktop.
Save Koronen/7118176 to your computer and use it in GitHub Desktop.
Script to migrate Memcached provider from Couchbase to Memcachier on Heroku.
#!/bin/bash
set -e
if [ $# -lt 1 ]; then
echo "Usage: $0 APP" >&2
exit 1
fi
app="$1"
heroku addons:add memcachier --app $app
heroku addons:remove memcache --confirm $app --app $app
tempfile="`mktemp`"
heroku config --app $app > $tempfile
servers=`grep MEMCACHIER_SERVERS $tempfile | awk '{print $2}'`
username=`grep MEMCACHIER_USERNAME $tempfile | awk '{print $2}'`
password=`grep MEMCACHIER_PASSWORD $tempfile | awk '{print $2}'`
heroku config:set MEMCACHE_SERVERS=$servers MEMCACHE_USERNAME=$username MEMCACHE_PASSWORD=$password --app $app
rm "$tempfile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment