Bakcup Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kahmoon
    Senior Member
    • Feb 2002
    • 116
    • 3.0.0 Gamma

    Bakcup Database

    I hope this is the right forum to post this.....it is a hint 4 people who don´t run vbulletin on their own Server or don´t have SSH access to their provider´s Server/database....
    I had the Problem that the backup via User CP didn´t work....i get a timeout there....even with phpmyadmin i wasn´t able to dump my database properly.
    This is a script to make a backup of ur whole database and save it into zip file on ur server/webspace what ever.

    Just create a small php file with following code.
    <html>
    <head>
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>DB Backup</title>
    <!-- TemplateEndEditable -->
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    <body>
    <?php

    $host= '';
    $user= '';
    $pass= '';
    $db= '';
    $date = date("d-m-Y");

    system(sprintf(
    "mysqldump --opt -h %s -u %s -p%s %s | gzip > %s/DBbackup_".$date.".de.sql.gz",
    $host,
    $user,
    $pass,
    $db,
    getenv('DOCUMENT_ROOT')."/DB_Backup"
    ));
    echo "<center><font style=arial>Database <b>".$db."</b> from <b>".$host."</b> saved.</font></center><p>";
    ?>
    </body>
    </html>
    Last edited by Kahmoon; Tue 5 Aug '03, 12:24am.
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    The only problem I see is that this is done via PHP and will liekly suffer from the same timeout problems as the backup option in the Admin CP and phpMyAdmin.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    • Kahmoon
      Senior Member
      • Feb 2002
      • 116
      • 3.0.0 Gamma

      #3
      maybe yes....but this script solved my problem..maybe it will help a few members to...i hope its ok to post such a script

      Comment

      • Steve Machol
        Former Customer Support Manager
        • Jul 2000
        • 154488

        #4
        You could have gotten lucky and your database size is just on the cusp of causing timeout problems.
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment

        • Kahmoon
          Senior Member
          • Feb 2002
          • 116
          • 3.0.0 Gamma

          #5
          i cases this script gonna timeout i have written one which saves every table in a seperate gz file....no timeout then

          Comment

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