Backing up wordpress data

Ok, so this falls into the category of ‘ blogging-about-blogging ‘. However I plan on doing this once a month and I don’t want to think about it too much. Backing up a wordpress dbms from a pagodabox site.

  1. create pagodabox tunnel
  2. get pagodabox dbms username
  3. call mysqldump command

Create a pagodabox tunnel

First you need to tunnel the pagodabox db1 virtual-machines port to your local box.

$ pagoda -a  tunnel -c 
# Component id example db1

Get the pagodabox username

Visit the pagodabox admin page to get the username and passoword for the pagodabox dbms running on the db1 virtual machine.
Go to<yourappname>

  • Click on your db1 instance.
  • Click on manage
  • grab username and password

Call Mysqldump command

Once you have your ssh tunnel created, you should have a port [3307] forwarded to your local machine. Now you simply need to call mysqldump like you would if the dbms was local.

$ mysqldump --add-drop-table -h -P 3307 --user  -p wp-db | bzip2 -c > blog_wp-db.bak.sql.bz2
Enter password: 

That’s it your database is backed up.