backing up database

Discussion in 'Databases' started by Cal813, Sep 13, 2009.

  1. #1
    I was just wondering what methods admins here use to backup their website?

    I normally used phpmyadmin, but for larger databases it does not help as much.

    What methods do you use to copy your database, and save it to your server and/or PC machine at home/office?
     
    Cal813, Sep 13, 2009 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    mwasif, Sep 13, 2009 IP
  3. arikene

    arikene Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    there is plugin on wp to backup nicely, or using backup from host
     
    arikene, Sep 13, 2009 IP
  4. thuankkk

    thuankkk Active Member

    Messages:
    503
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    95
    #4
    I use php script to execute mysqldump, then zip and send to my mailbox.
     
    thuankkk, Sep 16, 2009 IP
  5. ohteddy

    ohteddy Member

    Messages:
    128
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    28
    #5
    I use a combination of cron and shell script. I use rsync for shipping backups to another standby server.
     
    ohteddy, Sep 18, 2009 IP
  6. asoutiyal

    asoutiyal Peon

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i generally uses cpanel backup......
     
    asoutiyal, Sep 18, 2009 IP
  7. Sogrom

    Sogrom Peon

    Messages:
    154
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    cPanel backup works fine for saving or backing up but if your moving a big database the only way to go is SQLYOG. Its awesome, and free.
     
    Sogrom, Sep 18, 2009 IP
  8. Cal813

    Cal813 Active Member

    Messages:
    856
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    85
    #8
    what if I don't have access to SSH?

    Anyone here use cron jobs?
     
    Cal813, Sep 25, 2009 IP
  9. arimmer

    arimmer Peon

    Messages:
    103
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    phpmyadmin would be the best! but sometime if its huge superb, im prefered to use ssh :)
     
    arimmer, Sep 25, 2009 IP
  10. blingani

    blingani Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you code the scripts yourself I would prefer that you duplicate your original table.
    The copy will be the same and it will take data inputs same time as the original.

    then make such code
    eg.
    <?
    $orderdata = "INSERT INTO orderdata(package )
    VALUES ('".$_POST['package']."')

    $orderdata_backup = "INSERT INTO orderdata_backup (package)
    VALUES ('".$_POST['package']."')
    ?>

    the second table is a duplicate of the first but takes in data at the time as the first one.
     
    blingani, Sep 29, 2009 IP
  11. thuankkk

    thuankkk Active Member

    Messages:
    503
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    95
    #11
    If you don't have cron in your host, use some online cron jobs such as www.setcronjob.com (free 3 cron daily in 1 year), onlinecronjobs.com, cronjobs.org, etc.

    And, mysqldump doesn't require you to have ssh access :)
     
    thuankkk, Sep 30, 2009 IP
  12. jkapadia1983

    jkapadia1983 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    MYSQL Database Backup:

    Use mysqldump to create a simple backup of your database using the following syntax.

    mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]

    o [username] - this is your database username
    o [password] - this is the password for your database
    o [databasename] - the name of your database
    o [backupfile.sql] - the file to which the backup should be written.
     
    jkapadia1983, Sep 30, 2009 IP
  13. Cal813

    Cal813 Active Member

    Messages:
    856
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    85
    #13
    How do you run it without SSH access?
     
    Cal813, Oct 1, 2009 IP
  14. Traffic-Bug

    Traffic-Bug Active Member

    Messages:
    1,866
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    80
    #14
    You can use the mysqldump command to take the backups of your database.

    mysql:>mysqldump -help

    will give you the options for using the command.
     
    Traffic-Bug, Oct 1, 2009 IP
  15. Cal813

    Cal813 Active Member

    Messages:
    856
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    85
    #15
    and where would you use this?
     
    Cal813, Oct 1, 2009 IP
  16. kacangijo

    kacangijo Peon

    Messages:
    475
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #16
    What is SQLYOG ?
     
    kacangijo, Oct 2, 2009 IP
  17. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #17
    SQLYog is a MySQL GUI.
     
    mwasif, Oct 2, 2009 IP
  18. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #18
    Use the terminal..

    Log in to your server via SSH

    mysqldump -u YOUR_DB_USER -p YOUR_DB_NAME > YOUR_SQL_TO_BE_MADE_X-XX-2009.sql

    It'll prompt you for your password. Type it in. It'll generate an SQL file of your complete database.

    THEN...

    tar -cvf YOUR_SQL_FILE_GENERATED_X-XX-2009.sql
    gzip YOUR_SQL_FILE_GENERATED_X-XX-2009.tar

    Now you have a compressed file named YOUR_SQL_FILE_GENERATED_X-XX-2009.tar.gz

    Now log into your new (or other) server via SSH. And...

    ftp ftp.YOUR_OLD_SERVER_ADDRESS
    dir DIRECTORY_NAME
    get YOUR_SQL_FILE_GENERATED_X-XX-2009.tar.gz
    quit

    That'll transfer the backup file no matter how large it is... Then from the new servers terminal:

    tar -xzvf YOUR_SQL_FILE_GENERATED_X-XX-2009.tar.gz

    It'll decompress and extract YOUR_SQL_FILE_GENERATED_X-XX-2009.sql

    Then you type (assuming you created the mysql database and a user):

    mysql -u YOUR_DB_USER -p YOUR_DB_NAME < YOUR_SQL_FILE_GENERATED_X-XX-2009.sql

    And your server will automatically import the backup.

    Basically I gave you directions on how to transfer a database easily. The process can take a few minutes up to hours depending on how big yoru db is.
     
    NetStar, Oct 2, 2009 IP
  19. askm95

    askm95 Well-Known Member

    Messages:
    73
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    111
    #19
    as i know i always backup with control panel or cpanel
     
    askm95, Oct 3, 2009 IP
  20. Cal813

    Cal813 Active Member

    Messages:
    856
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    85
    #20
    I already told you.. I don't have SSH access to my server.

    I need other methods.
     
    Cal813, Oct 3, 2009 IP