Skip to content

Instantly share code, notes, and snippets.

@nathany
Created September 13, 2010 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathany/578129 to your computer and use it in GitHub Desktop.
Save nathany/578129 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Copies all data from the production database and populates the staging
# database with the dumped data.
echo "Dumping production data..."
mysqldump --add-drop-table --add-locks -e -l ys_production > /tmp/db_prod2stage.sql
echo "Populating staging data..."
mysql -e "use ys_staging; source /tmp/db_prod2stage.sql;"
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment