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.

How do I restore a cpanel sql backup via ssh?

Discussion in 'Database Discussions' started by CrewXp, Aug 16, 2006.

  1. CrewXp

    CrewXp Active Member

    Joined:
    Nov 12, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Hey. I have a question that I've been working on for a week. Before my old server went down, I backed up my mysql of a site through cpanel's backup feature.

    Well it won't upload the backup via phpmyadmin because it's formatted different (' 's)
    Example: When done via cpanel backup, it has this:

    Truncated for space...
    And phpmyadmin backs up like this:
    So my question is. Is there a way to upload my cpanel mysql backup via ssh? A certain command? Because it's WAY too big to upload via web. It's already on the server though.

    Thanks!!
     
  2. richy

    richy Well-Known Member

    Joined:
    Jun 30, 2003
    Messages:
    276
    Likes Received:
    1
    Trophy Points:
    16
    via SSH:
    mysql -D(databasename) < (sql file)
     
  3. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    If you have root access then

    # mysql databasename < somedump.sql

    will be sufficient.

    If not then

    # mysql -uUSERNAME databasename -pPASSWORD < somedump.sql
     
  4. CrewXp

    CrewXp Active Member

    Joined:
    Nov 12, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    that's not the same command the cpanel backup feature works is it...?

    because that's what I tried.

    I restored a smaller mysql cpanel backup through cpanel, and it worked. (a backup with the weird formatting)
    Then I tried the same backup through phpmyadmin and ssh (using that command line)

    And it didn't work.

    It seems cpanel's backup uses a little different format. (as seen above)

    Any help? Thx
     
  5. CrewXp

    CrewXp Active Member

    Joined:
    Nov 12, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    *bump* please!! I can't get my business online without it! Thx
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    mysql -u crewxp_crewxp -p crewxp_crewxpdatabase < /home/crewxp/DB_backups/crewxpsbackup.sql

    Will work fine.
     
  7. CrewXp

    CrewXp Active Member

    Joined:
    Nov 12, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    but it doesn't...


    I manually entered a PART of it in, and then exported via phpmyadmin (not cpanel), compared it. And it was the exact same. The difference can be seen above.
     
  8. CrewXp

    CrewXp Active Member

    Joined:
    Nov 12, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Did more investigation and found out this. It's only some tables in it that's not going in.

    DOESNT WORK
    DOESNT WORK
    WORKS
    what could be wrong? I think it's a compatibility issue when I upgraded servers, but how do I fix it? The unzipped sql file is 150 megs!

    THX
     
  9. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    How was the DB backed up?
     
Loading...

Share This Page