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 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

    Joined:
    Mar 6, 2003
    Messages:
    83
    Likes Received:
    1
    Trophy Points:
    8
    Hi,
    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

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    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
     
Loading...

Share This Page