PDA

View Full Version : Backing up for first time procedure.


tubedogg
Fri 7th Dec '01, 10:31pm
Q: How do I use Telnet or SSH as recommended to backup my database?

A: First you need to download a program to use Telnet or SSH. We recommend Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html). It's free and supports both Telnet and it's 'cousin' SSH (an encrypted version of Telnet).

After you've installed it, you need to enter your info to connect. 'Host Name' is usually your URL minus the 'www' part, although if this doesn't work you'll need to ask your host what your hostname is. If you host has specified that you must use SSH, click the 'SSH' radio button. Under 'Saved Sessions', in the box, type a name for this connection. Press Save, and then Open (at the bottom). In the future, just click on your Saved Session, click Load, then Open.

It'll pop up a new window; it may give a warning, just hit OK (or Yes, can't remember which it says). Type in your username, hit enter, type in your password, hit enter, and then you'll be at a prompt that looks something like this:

bash$

or

username@hostname:$

or something similar to one of those.

Type this:

mysqldump -uUSERNAME -p DATABASENAME > forumbackup.sql

Replace USERNAME and DATABASENAME with your correct information; it can be found in config.php for a memory refresher.

Hit enter after you type that, then enter your password (again from config.php) and hit Enter. Wait for a few seconds and it should eventually return you to the prompt (e.g. bash$). Assuming no errors, you're all set. You've got a backup, sitting in (most likely) the directory directly above your web root (e.g. your web root can be accessed on the web at http://www.mysite.com/ - on the server, this is probably actually a folder called public_html, and your backup is probably in the directory that contains the public_html directory).

That's it.

NeoGT
Mon 14th Jan '02, 9:19pm
Right, so is that the same thing as performing a mysql dump from the admin control panel? I have a 70+meg backup file on my harddrive that I downloaded. Plus, how do you restore a backup?

mjames
Mon 14th Jan '02, 9:24pm
Originally posted by NeoGT
Right, so is that the same thing as performing a mysql dump from the admin control panel? I have a 70+meg backup file on my harddrive that I downloaded. Plus, how do you restore a backup?
It is more efficient and less likely to not work if you go the SSH/telnet way. To restore your backup, from this (http://www.vbulletin.com/manual/movingservers.html):
Restore to new server

telnet into machine
create new database on the mysql (either via phpMyAdmin or telnet)
from the root, type mysql -uUSERNAME -pPASSWORD newdbname < /path/to/dump.sql
this takes a couple of minutes depending on your database size, but you can track the progress either by FTP (checking the /mysql/data/newdbname and see the files appearing) or by phpMyAdmin (you should see the files appearing there)
when it is completed, it will bring you back to the prompt

bbss
Tue 15th Jan '02, 7:12am
What about if I did not put password .. cause the password in the config file is .. (",") which mean no password was intered

LCD_Angel
Sat 16th Mar '02, 10:57pm
If I don't use the Telnet option and just download from the Admin area, what all do I need to download to my computer to backup ALL the info (excluding the actualy generic VB script) I need to restore the forum if it crashes?

TObject
Sun 9th Jun '02, 3:56pm
In my case, the mysqldump creates a file that is 11% smaller than backup sql created by the vBulletin admin control panel. Is this a reason to worry?

mjames
Fri 21st Jun '02, 12:24pm
Originally posted by TObject
In my case, the mysqldump creates a file that is 11% smaller than backup sql created by the vBulletin admin control panel. Is this a reason to worry?
It could be because the CP backup is not backing up the attachment table of the DB or something similar to that. In any case, I would see if it was a fluke and try the backups again and compare them.

TObject
Fri 21st Jun '02, 12:35pm
Well, they are different, that’s for sure. They have different headers, etc. Not very easy to compare two different 30 meg files. :)

mjames
Fri 21st Jun '02, 12:39pm
I meant you could make backups both ways and then compare their file sizes to see if one was corrupt the first time. FWIW, I would stick to the SSH backup method over the CP method which tends to be more unreliable.

TObject
Thu 4th Jul '02, 5:09pm
Questioon: What mode should be used for FTPing mysqldumped files? BINARY or ASCII?

Steve Machol
Thu 4th Jul '02, 6:51pm
Originally posted by TObject
Questioon: What mode should be used for FTPing mysqldumped files? BINARY or ASCII? ASCII

Visionray
Wed 27th Nov '02, 12:16am
Originally posted by smachol
ASCII I get this error

mysqldump: command not found.

I did everything you said here. Any ideas?

Steve Machol
Wed 27th Nov '02, 12:21am
You need to find out if mysqldump is installed on your server and if so, you need to use the full path to it. Ask your web host. They will know.

Visionray
Wed 27th Nov '02, 12:23am
Originally posted by Steve Machol
You need to find out if mysqldump is installed on your server and if so, you need to use the full path to it. Ask your web host. They will know. ok. Yea I tried using the full path as well and that didn't work. I will contact my host.

What if mysqldump isn't installed? Basically I can't make a reliable backup myself then? I have to do it via admin cp?

thanks

Visionray
Wed 27th Nov '02, 12:56am
Originally posted by Visionray
ok. Yea I tried using the full path as well and that didn't work. I will contact my host.

What if mysqldump isn't installed? Basically I can't make a reliable backup myself then? I have to do it via admin cp?

thanks


Just contacted my host.

Apparently my 50 dollars a month doesn't give me access to the system level, and I can thus not use mysqldump. Sucks eh?

So basically, I can't make reliable db backups then? there is no other way?

rockergrrl
Wed 27th Nov '02, 10:15am
$50/month, and you can't do mysql dumps?? :confused:

Who's your host??

Sounds like its time to move on out of there and find someone that will...

Steve Machol
Wed 27th Nov '02, 11:19am
Originally posted by Visionray
Just contacted my host.

Apparently my 50 dollars a month doesn't give me access to the system level, and I can thus not use mysqldump. Sucks eh?

So basically, I can't make reliable db backups then? there is no other way? You don't (or shouldn't) need root level access to run mysqldump. There is absolutely no reason not to allow customers to use this utility if they already have telnet/ssh access.

Roody
Tue 11th Mar '03, 5:05pm
You don't (or shouldn't) need root level access to run mysqldump. There is absolutely no reason not to allow customers to use this utility if they already have telnet/ssh access.

Ok this is a total newb question. I did a mysql dump and then downloaded it on my desktop to take a look. Exactly what in that .txt file allows you to restore a database in the event of moving servers or just a backup as a whole? Its so small.

Steve Machol
Tue 11th Mar '03, 5:52pm
How small is it and how large are your forums?

Roody
Tue 11th Mar '03, 6:35pm
How small is it and how large are your forums?

there is about 44mb of stuff in my forums directory. the forumbackup.sql file is 5k.

Steve Machol
Tue 11th Mar '03, 6:51pm
Then the backup is not complete. What was the command you used to make it?

Roody
Tue 11th Mar '03, 8:10pm
Then the backup is not complete. What was the command you used to make it?

I took it straight from Tubedogg's post.


mysqldump -uUSERNAME -p DATABASENAME > forumbackup.sql

naturally I changed the username and database info. :)

Steve Machol
Tue 11th Mar '03, 8:46pm
Well for whatever reason this backup is not complete. I suggest trying it again.

Roody
Tue 11th Mar '03, 9:39pm
Well for whatever reason this backup is not complete. I suggest trying it again.

ok ill give it a go and let you know what happens once I have done it. :)

john2k
Thu 13th Mar '03, 1:24pm
Is it best to turn the forums off before making a backup, or does it not matter?

Steve Machol
Thu 13th Mar '03, 1:25pm
Yes, it's preferable.

john2k
Thu 13th Mar '03, 1:35pm
Yes, it's preferable.

Steve, thanks for the reply. But I've got myself all confused now. LOL. I always turn my forums off before backing up. But wasn't sure if it was needed.... anyhow...

Your answer - do you mean whatever I prefer? Or the preferred way is to turn the forums off?

Does backing up not work properly/reliably if the forums are still on?

Thanks,

John

Steve Machol
Thu 13th Mar '03, 1:37pm
Since mysqldump locks each table when backing it up, it's unlikely that a major problem will occur by leaving your forums on. However 'unlikely' does not mean 'impossible'. The safest way is to turn your forums off while making the backup.

john2k
Thu 13th Mar '03, 1:39pm
Thanks a lot for the clarification, I appreciate it.

decostop
Mon 21st Apr '03, 2:00pm
I saw in a post above that I should not have to have root access to use the command: mysqldump. I cannot run the command..get an error that localhost cannot connect to mysql. I had the host admin run it, and it worked fine. She is trying to see why I can't run it... any ideas?

Is there going to be a better integrated backup feature in the new version? It seems that if you have a backup option in the admin cp, it should work, and if not... remove it.

Steve Machol
Mon 21st Apr '03, 2:24pm
The problem is with PHP - not vB. You are limited to PHP's timeout variable with any php script that performs the backup.

As for mysqldump, ask your host to make sure you have the necessary permissions to run it and ask him for the full path to it. You may need to enter the full path to run it.