The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to backup + restore large databases?

Discussion in 'General Discussion' started by GaryW, Nov 28, 2004.

  1. GaryW

    GaryW Active Member

    Joined:
    Apr 27, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Using the cpanel method sucks because it crashes my browser when I try restoring large databases since it outputs the entire input file to my browser, and I don't have SSH access.

    Any other methods to backup and restore?
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Another option is to use phpmyadmin and make sure that you select:

    Save as file
    zipped

    Since most MySQL data is text it should compress down nicely, and you will then e presented with a file to download. You can also restore a zipped file through phpmyadmin.
     
  4. LiquidAtoR

    LiquidAtoR Member

    Joined:
    Nov 28, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Try the attached file.
    Unpack it and upload it to your webdirectory.

    Set the variables in tool_settings.php to match your data of the database and set a password if you intend to keep the file on your server in mysql_tool.php.

    Upload your database.sql in the same folder.

    Open mysql_tool.php trough your webbrowser and follow online instruction on how to restore the database.

    Basicaly this tool enables you to restore large databases without the timeout you will receive trough php (e.g. phpMyAdmin).
    It cuts your database in little pieces and processes them, taking the next step where it left off the last time (it counts in %)

    At the end you get restoration complete, and the whole database is back in place.
    I've done this with databases over 200 MB without any problems.

    Good luck, Mike.
     

    Attached Files:

  5. FWC

    FWC Well-Known Member

    Joined:
    May 13, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Ontario, Canada
    Do it from the command line:

    mysql -u dbusername -p dbname < /path/to/backup.sql
     
  6. LiquidAtoR

    LiquidAtoR Member

    Joined:
    Nov 28, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    He doesn't have shell access, so most likely no command line ;)
    That's why he asked for alternatives to restore a large database.
     
  7. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Have taken the liberty of re-attaching the file originally posted by LiquidAtoR as the recent forum server change corrupted the avatars but also apparently previously attached files.
     

    Attached Files:

Loading...

Share This Page