Thread: Backing up…
View Single Post
Old 2003-08-27, 08:20 AM   #1
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
Lightbulb Backing up…

Drives fail, mistakes are made, are you backing up all of your work?

For most webmasters backing up their web folder is enough, but for sites that use a MySQL database backing up their web folder does not back up their database.

Let's say you have a database named MYDATA and its password is 1234 that you would like to back up.

First FTP into your server and create an empty text file named MYDATA.sql and CHOMD this file 777.

Then log into your server useing telnet or SSH and at the prompt type: mysqldump -uMYDATA -p123456 --opt MYDATA > path_to_MYDATA.sql. You can then download this file to your local drive for safe keeping.

To restore your database this is what you would do. Log into your server useing telnet or SSH and at the prompt type mysql -u MYDATA -p MYDATA < path_to_MYDATA.sql and after entering your password your database will be restored.

It is very easy using crontab and a short script to have your server do daily dumps that you can download for self keeping.
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote