hot to transfer a really huge database to another host

Discussion in 'MySQL' started by apple, Jun 6, 2008.

  1. #1
    Just wondering if someone starts a website on a shared host, and the mysql database grows really huge.. (lets suppose 1 GB).. how it is possible to transfer the 1GB database from one host to another.
     
    apple, Jun 6, 2008 IP
  2. mooseweb

    mooseweb Banned

    Messages:
    1,154
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    SSH or Telnet would work...

    Or just download and upload, but be careful with the 2nd method as a lot of strings might become broken.
     
    mooseweb, Jun 6, 2008 IP
  3. ajsbsd.net

    ajsbsd.net Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    if its unix(tm) based

    Source Host

    $ mysqldump -u username -p database > database.sql && scp database.sql new.unix.host.net:.

    Destination Host

    $ echo "create database database" > tmp.sql ; mysql -u username -p < tmp.sql
    $ mysql -u username -p database < database.sql
     
    ajsbsd.net, Jun 6, 2008 IP
  4. jdavidson

    jdavidson Peon

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you had PhpMyAdmin then you can just use the 'export' function from your old host, save the exported DB then use the 'import' function on your new host.

    This will take time to download/upload the DB, so be patient if you decide to use this method.
     
    jdavidson, Jun 6, 2008 IP
  5. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #5
    I would go with this method if you can. I personally use Navicat, which I have used to transfer 10GB+ Db's without problem.
     
    jestep, Jun 6, 2008 IP
  6. Stephanie_Lee

    Stephanie_Lee Banned

    Messages:
    55
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hello,
    You can Try using the script called mysqldumper ( mysqldumper.de) and configure it to take backups in parts of small size like 100mb or so.

    But this can be a hectic process. so do it through SSH command thats it.
    connect thro putty and put in the command : ( linux)

    mysqldump -uuser -ppass -h localhost dbname > backup_file_name.sql

    then transfer the backup file to ur other host, and import it to your new mysql database through this command :

    mysql --user=user --pass=pass --host=localhost db_name < file_name.sql

    hope it helped :)
     
    Stephanie_Lee, Jun 7, 2008 IP
  7. clinton

    clinton Well-Known Member

    Messages:
    2,166
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    110
    #7
    Make sure your doing it with Linux so it doesn't crash;)
     
    clinton, Jun 7, 2008 IP
  8. ki3000

    ki3000 Active Member

    Messages:
    361
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #8
    I tried this method. but didn't work out well for me even though the DB wasn't even half this size. i would recommend a different method for a big DB such as this.
     
    ki3000, Jun 7, 2008 IP
  9. Stephanie_Lee

    Stephanie_Lee Banned

    Messages:
    55
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #9

    u cant do it with phpmyadmin, connection gets timeout. phpmyadmin is good only for taking backups of databases less than 15~20mb thats it.
     
    Stephanie_Lee, Jun 8, 2008 IP
  10. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #10
    Try Navicat: http://www.navicat.com/

    They have a free trial, and a free personal version for non commercial. I've personally used it for DB's over 10GB.
     
    jestep, Jun 9, 2008 IP
  11. arpitagarwal82

    arpitagarwal82 Notable Member

    Messages:
    2,996
    Likes Received:
    398
    Best Answers:
    0
    Trophy Points:
    280
    #11
    use bigdump to import database through FTP.
    its a free script.
     
    arpitagarwal82, Jun 10, 2008 IP
  12. benjaminp

    benjaminp Guest

    Messages:
    1,212
    Likes Received:
    16
    Best Answers:
    2
    Trophy Points:
    230
    #12
    I would have to second that. I used it to transfer my database with no problems.
     
    benjaminp, Jun 10, 2008 IP