Open aiwilliams opened 7 years ago
@aiwilliams I don't know if this is a good idea but it seems to work pretty well.
backup.sh
cd ~/Documents/Programming/
cp -r neowisdomonline neowisdomonline-backup
zip -r9 neowo-backup.zip neowisdomonline-backup
rm -rf neowisdomonline-backup
Does that include the database? You have to be a bit careful about database backups because the MySQL server provides tools to do it properly.
@aiwilliams Haha, oops... It doesn't. But the new and improved version does! Note that it assumes your working directory is Documents/Programming/, your project is named neowisdomonline, and that you have a neowo host in your ssh config. :grimacing:
backup.sh
cd ~/Documents/Programming/
mkdir neowo-backup
cp -r neowisdomonline neowo-backup/filesystembackup
ssh neowo << EOF
mysqldump wordpress_default --result-file=/vagrant/neowo-dump.sql
logout
EOF
mv neowisdomonline/neowo-dump.sql neowo-backup/databasedump.sql
zip -r9 neowo-backup.zip neowo-backup
rm -rf neowo-backup
We have discovered that we need only back up the uploads folder and the database. Now, I must write a restore script that unzips the backup, places the uploads and the database in their proper locations, and installs the theme and plugins.
We'll want to use the Wordpress CLI to script theme and plugin installation.
As progress is made in a local environment we'll need to back up the database and the filesystem in a way that can be restored locally and to Dreamhost.com.