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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Restore database from Raw files

Discussion in 'Database Discussions' started by Taha Haider, Sep 29, 2017.

  1. Taha Haider

    Taha Haider Member

    Joined:
    Dec 24, 2015
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    jeddah
    cPanel Access Level:
    Root Administrator
    Hi,

    My Server got crashed recently, I have backup of all files including /var/lib/mysql

    how can I restore the databases from the raw files I have?
     
  2. hydn79

    hydn79 Member

    Joined:
    Feb 1, 2013
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    First make a copy of /var/lib/mysql

    Then you can restore by copying the files in /var/lib/mysql to a new server. Or restoring to the old server after fresh mysql install.

    If the backup is corrupt then thats another thing altogether and not really a backup. But rather the db files in their crashed/corrupt state.

    Depending on table type check innodb_force_recovery: MySQL :: MySQL 5.7 Reference Manual :: 14.21.2 Forcing InnoDB Recovery
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Were account backups enabled on this system, or do you only have a copy of the filesystem?

    Thank you.
     
Loading...

Share This Page