How to transfer the Database?

Discussion in 'Site & Server Administration' started by jeros, May 8, 2009.

  1. #1
    Hello Friends,

    How can I transfer the database of a Website from one server to another server?
     
    jeros, May 8, 2009 IP
  2. Progg

    Progg Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The best way i've come across doing this is with mysqldump. You need to first save the database with

    mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz]

    then FTP the backupfile.sql.gz off the server and upload it to whatever server you are transferring it to.

    Then issue the command to restore the database

    gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]


    I am pretty sure when you're restoring the DB you need to be certain the DB table structure is in place before the restore

    Goodluck
     
    Progg, May 8, 2009 IP
  3. jeseka

    jeseka Banned

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think You can only use this to move your DB to another server from Cpanel .
    Greetings
     
    jeseka, May 8, 2009 IP
  4. sreyas

    sreyas Well-Known Member

    Messages:
    128
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Or you could use phpmyadmin.

    There you can export the database with full structure and data to a zipped file. Then from the new server you can import the same zipped file to restore the full file. Please note if your database is huge you won't be able to do this using phpmyadmin as the script execution will get timed out. This is recommended for small db's only.

    Regards,
    Sreyas
     
    sreyas, May 9, 2009 IP
  5. mrdo

    mrdo Well-Known Member

    Messages:
    1,552
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    138
    #5
    use control panel to backup and restore. simple & easy
     
    mrdo, May 9, 2009 IP
  6. naveenkumar

    naveenkumar Well-Known Member

    Messages:
    280
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #6
    Recently I have imported a database of 500 MB with just few clicks with BigDump script. Read more and get it here: http://www.ozerov.de/bigdump.php

    You can export your database quickly with unix commands shown by Progg, from phpMyAdmin or a backup facility provided by host. You can also ask the support people to do it for you.
     
    naveenkumar, May 9, 2009 IP
  7. bratosab

    bratosab Active Member

    Messages:
    324
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #7
    All the methods I could think of are sated above, but i would choose PHPMyAdmin.
     
    bratosab, May 10, 2009 IP
  8. daremkd

    daremkd Peon

    Messages:
    1,085
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You Can find backup/restore DATABASE option in Cpanel.. So you can easily backup or move you database :)
     
    daremkd, May 13, 2009 IP
  9. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #9
    Which type of database it is? Is it MySQL, MSSQL or other?

    Kailash
     
    kailash, May 13, 2009 IP
  10. Terryness

    Terryness Guest

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    This is for MS SQL Databases. When you said server to server I assume you have full admin control.

    serverintellect.com/support/sqlserver/sql-database-attach.aspx
     
    Terryness, May 14, 2009 IP
  11. hostcoin

    hostcoin Peon

    Messages:
    75
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    If you have cpanel with your old host and same at new host then you can transfer your database through cpanel itself. Most of web hosting companies do it for their clients.
     
    hostcoin, May 16, 2009 IP