No announcement yet.

How do I backup the DB using SSH?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I backup the DB using SSH?

    Ok, my host just got back to me and told me they've enabled SSH for the forums sub-domain so I can do database backups (the entire DB is probably around 50mb or more, so the built-in PHP utility doesn't work). How do I use SSH to download the database? And do I need to download anything else?

    Someone mentioned something about "dumping" the info to a file and then using FTP to retrieve it from the server (if that makes any sense). I'm totally lost here, please help me out.

  • #2
    Ta Da! -


    • #3
      Telnet/SSH into your system (we'll call it machine1)
      How do I do that?


      • #4
        First of all, you need a Telnet Client.
        If you don't have one download Putty ( or find another one you like.

        Use That Program to SSH into the system.


        • #5
          What would be the "host name" (I can't put in an IP because we're using a virtual server).


          • #6
            Usually just your domain name.
            --filburt1, moderator
            Web Design vB Board of the Month
            vBulletin Mail System (vBMS): webmail for your forum users


            • #7
              Ok, I'm in, now I get this line:


              What do I do now? The "moving servers" guide isn't exactly step-by-step and I have no idea what I'm doing and don't want to screw anything up. I don't even know where the DB is located. Any help?


              • #8
                I think at this point, you just type in this line...

                mysqldump -uusername -p databasename > backupname.sql

                (1) username is your own username for that domain account
                (2) databasename is just the name of your database. You don't need to know exactly where it's located.
                (3) backupname is whatever name you choose to call your backup database. I suggest you include the date in the name.

                You will be prompted to type in the password.


                • #9
                  Correct except 'username' is the username for your mysql database, which might be different than the one you used to login to SSH with. It's the same username as in your vB config.php.


                  • #10
                    Well, I'm still trying to get it to work (getting permission denied errors, but my host is working on it). Anyway, I'm curious, can you do a MySQLdump with phpMyAdmin?


                    • #11
                      Get into phpMyAdmin.

                      Click the name of the database which you want to backup. (left side of your screen)

                      Next, click 'Export' (right side of screen)

                      Select all the tables, and make sure you select 'Structure and data' You might want to put a checkmark by 'Save as file'

                      Finally - Click 'Go.'


                      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.