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!

How to restore mysql databases from /var/lib/mysql/user_database/ files only

Discussion in 'General Discussion' started by bjdea1, Feb 11, 2008.

  1. bjdea1

    bjdea1 Well-Known Member

    Mar 6, 2003
    Likes Received:
    Trophy Points:
    as the title asks. I recenlty had a hardrive failure and luckliy I can still access certian directories on this drive. I can still access the /var/lib/mysql/ direcoty which holds all the users databases and have backed all these up using tar.

    Now what I need to know is how do you restore these database files to another server? I tiried simply untar'ing one of these to a new server - for one single user - and it stuffed up Mysql - it went offline.

    So how can I get these database files to fully work on a new server? Please any help would be greatly appreciated.
  2. kernow

    kernow Well-Known Member

    Jul 23, 2004
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Login to the old server via ssh and use rsync to transfer the databases to the new server. Example;
    #rsync -avz --delete -e ssh /var/lib/mysql new_server/var/lib/mysql
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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