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.

MySQL Dump

Discussion in 'General Discussion' started by nick1, Feb 28, 2008.

  1. nick1

    nick1 Member

    Joined:
    May 21, 2006
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I have 2 servers:

    server1 and server2

    I have 50 databases on server1 and i want to migrate them to server2. Can you anyone please tell me how do I restore mysql dump in server2.

    server2 already has some databases,

    If I take dump of mysql dbs from server1 by using following commands

    mysqldump --all-databases > mysql.sql

    then how do I restore this dump to server2?

    Thanks in advance
     
  2. meghraj

    meghraj Member

    Joined:
    Apr 4, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    MySQL restore

    Hello,

    As I know the simple way to transfer your server 1 databases to server 2. You may use phpmyadmin (which is available under cPanel) tool to export your database. In cPanel click on MySQL databases Tab and you will find at the bottom PhpMyAdmin link. Click on that you will be entered in phpmyadmin. You will find the Export link, click on that and you can take database backup and can provide the path where you want to store that backup. After that you can restore it on server 2

    I am also new to forum. Hope It might be helpful for you.


    Thank you ! :)

    Regards,
    Meghraj.
     
  3. dwh2

    dwh2 Well-Known Member

    Joined:
    Jan 14, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Meg, that's not the best advice for 50 databases. It can be useful for individual tables within a database, but not so much for huge amounts of data. His method is the best...options can be found here:

    http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

    I've never reimported multiple databases in one shot, so all I can tell you is if you dump them one at a time, you can import the data with this command:

    /path/to/mysql -u username -ppassword dbasename < /path/to/mysql.sql

    I'm sure if you do some searches in the manual I linked to above you can find how to import all the databases at once..
     
Loading...

Share This Page