Automating Restores for Deki Wiki
If you've got your backup script running for Deki Wiki, and stakeholders are busy adding knowledge - it might be time to build a test environment if you haven't already. After the backup of the production server runs, we're restoring the attachments, and .sql file to our test box. There are some obvious benefits of having a test environment, including...
- We have a tested and automated restore procedure that we know works because it happens every day
- A box we can test stuff without having to worry about breaking a production box
#!/bin/bash
today="$(date +%a)"
#mount Windows Share
sudo -u root -p password smbmount //server/share /mnt/subdir -o username=user,password=password,rw
#copy down Today's database and attachments
cp /mnt/share/$today.wikidb-backup.sql /home/user/tmprestore
cp /mnt/share/$today.attachments-backup.tar.gz /home/user/tmprestore
#restore Today's database and attachments
cd /home/user/tmprestore
sudo mysql -uroot -ppassword wikidb < $today.wikidb-backup.sql cd /var/www/deki-hayes sudo tar xvzpf /home/user/tmprestore/$today.attachments-backup.tar.gz
2 comments:
Great! As an additional resource to your readers there is the Deki Wiki FAQ section: http://wiki.opengarden.org/Deki_Wiki/FAQ this article might provide additional info: http://wiki.opengarden.org/Deki_Wiki/User_Manual/Backing_up_your_Deki_Wiki and perhaps could be enriched with your post. :-) Feel free to edit/add info. Thanks for helping on docs and for help spreading the word.
Thanks for the comment and the link! For what it’s worth, I’ve already have contributed to the FAQ, and plan to continue doing so!
Post a Comment