Topic: Backup Database Excluding Search Tables Restore To New Test DB
Hey everyone!
I cobbled together a process which allows me to do the following through ssh / shell (I use Putty)
1) Backup my punbb DB EXCLUDING all the search tables (my DB is 90mb with search tables and only 35 without)
2) Add drop tables if the table exists
3) Restore the DB to a copy of my forum to a location where I can run tests on an exact copy of my production site without worrying about impacting the live forum
Here's what I do:
1) Copy all files from my main forum to another location:
cp -f -p -r /home/site/www/folder-production /home/site/www/folder-test
2) Backup my main punbbDB and only the non-search tables:
mysqldump --add-drop-table -u username -p db_name bans categories censoring config forums forum_perms groups online posts ranks reports subscriptions topics users > /home/site/forumdb.sql
3) Restore my main punbbDB and only the non-search tables to another DB I've already setup:
mysql -u username -p NEWdb_name < /home/site/forumdb.sql
So, how does that look? Is this a good way to setup a test environment and also have a perfect backup of my forum in case I need to redirect to it?
If you have any comments / suggestions I'd love to hear them. Also, any way to completely automate this whole process into a single batch file?
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews