Skip to content

Instantly share code, notes, and snippets.

@wesbos
Created February 7, 2012 15:15
Show Gist options
  • Save wesbos/1760164 to your computer and use it in GitHub Desktop.
Save wesbos/1760164 to your computer and use it in GitHub Desktop.
gsed wordpress DB to production
Simple little snippet that I always forget. I use this to quickly find/replace all references to any paths within a wordpress DB when migrating. Much faster than using a GUI
You must have gsed installed, used macports to do this. Native osx sed sucks.
usage: gsed -i 's/[old-url]/[new-url]/gi' database-name.sql
Example:
gsed -i 's/localhost\/wordpress-local\/subfolder/production.com/gi' livedb.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment