Skip to content

Instantly share code, notes, and snippets.

@rlr
Created May 17, 2012 19:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlr/2721239 to your computer and use it in GitHub Desktop.
Save rlr/2721239 to your computer and use it in GitHub Desktop.
fabfile for getting new db dump
from fabric.api import local
def get_db_dump():
local('scp username@host.mozilla.org:/data/www/sumodump.sql.gz .')
local('gunzip sumodump.sql.gz')
def load_dump():
local('mysql -e "DROP DATABASE kitsune;"')
local('mysql -e "CREATE DATABASE kitsune;"')
local('mysql kitsune < sumodump.sql')
def schematic():
local('schematic migrations')
def anonymize():
local('mysql kitsune < scripts/anonymize.sql')
def refresh_db():
get_db_dump()
load_dump()
anonymize()
schematic()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment