
Notes to myself. Using the bluehost site backup tools did not go as expected. One minute there were 300+ public posts the next day there were 72. Weird I thought. I am happy that I did a manual dump last month. Here are the steps I took to restore my content:
- Export the remaning blog posts with the export function from my wp-admin export page. Lucky for me the sites small and I can just export everything and still get a reasonably sized file.
- From my laptop:
- scp last-months-database-backup.sql to my bluehost account
- Log into bluehost command line and run the following:
- mysqldump -u -p dbname wp_users > wp-users.sql
- Open the command line mysql client: mysql -u -p dbname
- On the mysql command line client: use dbname
- On the mysql command line client: source last-months-database-backup.sql
- On the mysql command line client: source wp-users.sql (I think there was a confilct when I did step #9
- Go back to the website admin import area
- Use the wprdpress admin import function select the file created in step #1.
- Be happy I can do this for myself :)
Happy Friday! I think its Time to write my own script that I can run from my laptop. Here is what I need it to do:
- Log into bluehost account
- Create an archive of the web root folder and sub-directory’s
- Dump the database into the archive
- scp the backup file from bluehost to my laptop
- Send myself a notification so I can add redundancy by making sure it gets onto the computer backed up with CrashPlan.
Manually this can be acomplished with the following:
- mysqldump -u -p database_name > SITENAME-YYYY.MM.DD.sql
- mv SITENAME-YYYY.MM.DD.sql /path/to/website/root
- tar -zcvf ~/SITENAME-YYYY.MM.DD.tar.gz /path/to/website/root
- exit (leave the webhosting server)
- On my laptops command line …
- scp username@host:~/SITENAME-YYYY.MM.DD.tar.gz .
After all of that, I end up with a file on my local computer that I can send to the home computer to be backed up with CrashPlan or put it somewhere else that is safe.