Tutorial: MySQL Restoring and Backups. Automated Backups Guide

Status
Not open for further replies.
Joined
Jun 29, 2012
Messages
158
Reaction score
237
Tutorial.

How to backup your hotel efficiently, and restore it fast.
This tutorial was written by John from NextGenHabbo.com on August 01 2013

____________________________________________________________________________
After Running NGH for two years, we always ran backups through navicat,
restoring them and backing up took a long time, and the bigger the database
became, the harder it was to restore things fast, with the items table taking
up to an hour to restore. Also manual restores take time and effort, here i'll
show you a tool that does automatic hourly backups, and saves the data to
either a folder, or an FTP on another server.

If this tutorial helped you, leave a like. Or Send me a PM if you need help.
____________________________________________________________________________


Tutorial One: Backups

-> Setup
1] Login to your VPS AND/OR Dedicated Server.
2] Head to
3] Download MySqlBF
4] Install MySqlBF
5] Run MySqlBF

-> Config
1] Click 'Connect to MySql Server
2] Type in your MySQL Details
3] Tick your SQL Tables you wish to backup
4] Select a folder where you would like to store your backups, or enter the ftp details.
5] Tick Schedule this job then click the cogwheel
6] Change the setting to backup every 1 hr
7] Run Scheduled job as 'Set as Current User'
8] Type in your password if UAC asks.
9] Save and Close.
10] Click Save in the top left corner.
* May not be needed, is for me. 11] Load the save you just created.
11] Click Jobs to see if it's scheduled for the next hour.

And there we go, backups now take place every hour, and even compress into zips when completed.
This is a much faster and more efficient solution than using navicat to backup your tables.

____________________________________________________________________________
Now I can hear some of you saying 'oh but navicat lets me backup individual
tables wah wah.' Okay, yeah true. However with the following solution
restoring MySQL Backups is much faster, and restoring the whole database
in a way is almost as fast as trying to restore a table in navicat.

Tutorial Two: Restoring
Now, for this we're going to use the command line, trust me. It sounds hard, but
i'll help you through it ;)

BEFORE DOING THESE STEPS. TAKE YOUR BACKUP YOU WANT TO RESTORE AND PLACE IT IN
THE c:\ DRIVE AND NAME IT backup.sql :)


1] Open Command Prompt (click start -> run -> type 'cmd.exe'
2] Now we're going to head to the main mysql folder. Type the following:

'cd C:\Program Files\MySQl\MySQL Server 5.6\bin'
->Note 5.6 is my version, check yours.

3] Now you're be in the MySQL Folder. type
'mysql.exe -u root -p DATABASENAMEHERE'
4] Now type in your MySQL password
5] Now type:
'source < C:\backup.sql'
* Note if that doesn't work type 'source C:\backup.sql'



Thats the backups, there we go ;) Enjoy!
Pictures can come soon if you think the tutorial needs them!
 
Status
Not open for further replies.
Back