Skip to main content

Restoring selected data on a new server

Comments

8 comments

  • ffeingol
    DNS information will be in /var/named Each domain will have a file in the format domain.tld.db. It's just a text file (in bind format) so it's quite easy to look at / compare to what you have. Databases will be a lot more complicated. The actual database files are stored in /var/lib/mysql/DATABASENAME The problem is that they are stored the way that MySQL wants them and you can't directly access those files. The second issue is the storage engine used. If in they are myisam then everything is stored in the database folder. If they are innodb it's more complicated. Can your host provide any cPanel backups instead of a raw system backup? a cPanel backup would have the database in mysql dump format (basically create table / insert data) and that is much easier to recover from.
    0
  • ddaddy
    Thanks for your reply. There is an additional folder of backups that look like they were created separately as they contain folders like /dnszones which has all my DNS records. /homedir which has all my html data and there's one called /mysql which has files for the account I want to restore the db called .create and .sql I take it I can use these to recreate the database schemas and data? Any suggestions on copying the mail accounts with passwords?
    0
  • ffeingol
    That actually sounds like a cPanel backup. For the MySQL all you need are the .sql files. Create the databases/users via cPanel and then you can use phpmyadmin to import the .sql file into the database. From memory, email passwords should be in /homedir/etc/domain.tld/etc passwd will have the mailbox names and shadow will have the hashes/salted passwords. The passwords are really not of much use as they are in their encrypted (hashed/salted) format.
    0
  • ddaddy
    Thank you. I don't need to see the passwords, I just need the mailboxes to continue to work on peoples devices without me having to get them to change the email password. Can I copy over the emails and passwords and the account will appear in CPanel, or should I recreate the mailbox first with the same username, then copy over the password files and emails?
    0
  • ffeingol
    Personally I'd create the mailboxes in cPanel and then try to copy things over. The shadow file is a colon ( : ) delimited file. the first field is the mailbox name and the second is the hashed password. That file is not really intended to be hand edited so YMMV if it works or not. You'll be able to tell if you look at the file /var/log/maillog In that file you'll see successful / unsuccessful IMAP/POP email logins. For future reference (it sounds like you way to far down the line of manually restoring) that file that you have is a cpanel backup. cPanel support could have guided you as to where to upload it and then you would have just been able to use the WHM restore functionality and you would have been done.
    0
  • ddaddy
    Thank you for the help. Everything is back to normal and working great :) Unfortunately, my web host has not been very helpful at all! In fact, it's been the worst customer service I have ever received! After routine maintenance, they had issues which is understandable. However a lack of updates on the situation and open ended "We're working on it" claims have been extremely frustrating. Today is day 8 and my server is still offline with the last update 4 days ago. I took it on myself to get an AWS server up and running to get some websites back up and emails working again. I've spoken with several other clients of theirs that have lost out on a lot of money due to having their servers offline over black friday. Sorry about the rant, but thanks again for your help.
    0
  • cPRex Jurassic Moderator
    Awesome collaboration here, @ddaddy and @ffeingol !!! I'm glad you were able to get things working well, but it does sound like looking for a new host may be in your future.
    0
  • ddaddy
    Thanks Happy with AWS now. All working great.
    0

Please sign in to leave a comment.