Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Help Request: WHM transers account from server but not DB

Discussion in 'General Discussion' started by Hockey Addict, Apr 8, 2003.

  1. Hockey Addict

    Hockey Addict Member

    Joined:
    Apr 8, 2003
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    151
    I am moving my hockey site from one dedicated server to another. I used the transer account using root in WHM to pull the files off my old server. It is pulling my php and html files BUT when I go into cPanel.. there are no DB'd to be found and this account has four including a large VB database. How do I move my SQL DB's to my new server?
     
  2. Keegan

    Keegan Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    109
    Likes Received:
    0
    Trophy Points:
    316
    cPanel Access Level:
    DataCenter Provider
    mysqldump
    then tar
    then wget
    then mysql -u -p databasename /local/locationafterwget

    In other words, manually move it and import it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. NNNils

    NNNils Well-Known Member

    Joined:
    Sep 17, 2002
    Messages:
    580
    Likes Received:
    0
    Trophy Points:
    166
    I recommend using scp
     
  4. Hockey Addict

    Hockey Addict Member

    Joined:
    Apr 8, 2003
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    151
    what is that?
     
  5. Networkologist

    Networkologist Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    166
    Here's another way

    But you can get a trial version of an scp program here:

    http://www.siliconcircus.com/

    This how to guide is for Linux/Unix and has a few assumptions: Assumes: server1 = old server server2 = new server
    server1$= is ssh prompt for old server server2$ = is ssh prompt

    for new server USERNAME = mysql username databasename = mysql database name newdbname = newly created mysql database
    on new server dump.sql = your backed up mysql database

    A. Backup current database:

    1. ssh into your system from the root directory, type

    mysqldump --opt -u USERNAME -p databasename >/path/to/yourbackupdirectory/dump.sql you'd be prompted for your mysql password and then once backed up it will bring you
    back to the prompt

    2. verify that you have a dump.sql in the /path/to area you specified

    3. tar/gzip compress the file for faster transfer by typing at prompt server1$ cd /path/to/yourbackupdirectory server1$ tar -cvf - dump.sql | gzip -c >
    dump.tar.gz

    4.ssh into server1, and from the command prompt type the following:

    server1$ cd /path/to/yourbackupdirectory server1$ ftp server2 (IP or host) - this should open a connection and ask for your username/password ftp> bin ftp> cd
    /path/to/newdirectory ftp> put dump.tar.gz (should take a few minutes, depending in the file size) ftp> close ftp> quit

    5. verify dump.sql is in the /path/to/new area on the new server B.


    Restore/importing backup to new server

    1. untar/unzip uncompress the dump.tar.gz file by typing server2$ cd /path/to/new server2$ gunzip -c dump.tar.gz | tar -xvf -
    you'll end up having a file, dump.sq at /path/to/new/dump.sql

    2. ssh into server2 create new database (i.e. named newdbname) on the mysql (either via phpMyAdmin or ssh) as root user type mysql -u USERNAME -p newdbname <
    /path/to/new/dump.sql you'll be prompted for your mysql password and then mysql will import the database backup file
    dump.sql into new database named newdbname this takes a couple of minutes depending on your database size.

    When it is completed, it will bring you back to the prompt
     
  6. NNNils

    NNNils Well-Known Member

    Joined:
    Sep 17, 2002
    Messages:
    580
    Likes Received:
    0
    Trophy Points:
    166
    This is how I do it:

    Old server:

    cd /var/lib/mysql
    tar -zcvf filename.tgz databasename

    New server:

    cd /var/lib/mysql
    scp serverx.serverdomain.com:/var/lib/mysql/filename.tgz ./

    [ enter password ]

    tar -zxvf filename.tgz

    Done.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice