View Full Version : backup database ? what first ?
eva2000
Mon 10th Jul '00, 7:40pm
i read the following
-----
To backup your database using a dump from telnet, use this command:
mysqldump -u mysqlusername -p database_name > output_file_name.sql
That'll prompt you for your password and export the database into a script that you can use to recreate the database if there is a problem.
Here is how you can restore it:
mysql -u mysqlusername -p database_name < input_file_name.sql (which was previously output_file_name.sql)
-----
what do i do first ? do i shut down the board before i do the dump ?
how come some times i see the instructions given to dump to a .txt instead of .sql file ?
also where will the dumped file end up on my server - which directory ?
SonnetCelestial
Tue 11th Jul '00, 10:26am
Always shut down your board first if you want to backup your database soon.
However there are a few things you need to understand:
1) do you have a dedicated server? if so, doing a db dump won't trigger a hernia from your web host providers.
2) Do you have or do you want to get phpmyadmin? It's a script that makes database dumping and just almost anything about it easy.
3) you can dump to either .sql or .txt. I think your server should take either or
4) you should change that input_file_name back to output_file_name. The file is stored onto the server and unless you are ,using phpmyadmin, the file will be stored onto the server drive and you will need the same name.
As for where it is, you *might* be able to specify the location when you give the command. For example:
mysqldump -u eva2000 -p db34153 > /home/eva2000/public_html/dbbackup.sql
This would put the database backup under the public_html directory. OF course this is just fake information so you would need to replace it with the real info
eva2000
Tue 11th Jul '00, 10:53am
thanks okay...
1. yep i have my own red hat linux 6.2/apache server using webmin control panel - also admins the mysql database - newbie to admining and webmin :)
2. i have phpmyadmin downloaded but don't have a clue how or where to install it on my server - the config setup from the site is confusing :confused: :( - i plan to backup once or twice a week given that over 2400 posts/week are made.
3. okay i will probably use .sql
4. okay... i am thinking of doing it from telnet so no phpmyadmin for now..
so how i do know i successfully dumped the database ? will it tell me ?
oh nearly forgot, how long does it take to process the dump ? dependent on how large the forum database is ?
[Edited by eva2000 on 07-11-2000 at 10:55 AM]
eva2000
Tue 11th Jul '00, 7:38pm
Also does doing a dump of the database also backup templates that have been modified or added ?
SonnetCelestial
Tue 11th Jul '00, 9:04pm
(sorry trying to fix my current database)
I am also installing server applications but since you are on linux you have it much easier.
Basically for phpmyadmin you install it onto any directory you want. You edit the config file (forgot the entire name) to match your database settings. Then you run the index.php script and you should be good to go. BTW in the file just leave the advanced authentication to false.
I'm also writing a cron script for myself that I will post up later. It will backup table by table since I have a virtual provider.
You will know it successfully backed up the database if the file size from the backup matches the file size you see in phpmyadmin.
As far as dumping is concerned it may take quite some time depending on how large your database is. Just keep in mind, how fast does your computer write 10MB? Also if you are downloading this information, how fast does your connection allow you to download 10, 20, etc MB?
Finally when dumping a database You should remember that you select Structure and Data then send in phpmyadmin.
Obviously I would get phpmyadmin up before worrying so much about everything else. :)
eva2000
Fri 14th Jul '00, 11:44am
now i have phpMyAdmin working what do i do ?
eva2000
Fri 14th Jul '00, 12:22pm
well i ended up trying
mysqldump -u mysqlusername -p database_name > output_file_name.sql
on a dummy database as practise before i did it on the actual one... and it worked... :D
thanks :)
now the *.sql file is around 5 MB in size... what's the best way to compress it and download it ?
vBulletin® v3.8.0 Alpha 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.