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 backup my server?

Discussion in 'Data Protection' started by LordLiverpool, Apr 14, 2016.

  1. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hello

    Apologies in advance for my lengthy post but I wanted to be verbose to make finding an answer easy.

    I'm not sure what is the best way to backup my server!?!

    Background to problem:

    After having recently opened another thread here on the cPanel Forum. One of the cPanel engineers kindly logged into my VPS server and told me the problem was my web server's HDD was about to fail. So obviously I need to back it up ASAP.

    I contacted my web server provider and they told me that backups was my responsibility. (oh the joy!) I wrongly assumed this would be done automatically.

    This is what I did next:

    Attempt #1: FTP backup to local machine using WinSCP.

    I simply tried to FTP my entire server (36GB) down to my local machine, but after 6 hours and 9GB my ISP strangled my connection to less than 50Kbps from 25Mbps. This meant I was unable to load even simple webpages in my browser. The backup would take weeks to complete if they kept choking my connection, thus making this option impractical.

    Attempt #2: WHM backup to Amazon S3.

    I read this cPanel thread:

    How to configure Amazon S3 backups in WHM

    So
    • I opened an Amazon S3 account.
    • Created a Bucket.
    • Created a user. (I was prompted on screen by Amazon S3 to stop "financial" abuse).
    • Saved my Credentials i.e. Access Key & Secret Access Key.
    Then I went into:

    WHM > Backup Configuration > Additional Destinations > Create New Destination.

    Filled in the form:
    • Destination Name - gave it an arbitary name.
    • Transfer System Backups to Destination - ticked this checkbox.
    • Folder - gave it an arbitary name of VPS_backup. I also tried without a folder name but it made no difference.
    • Bucket - name of my bucket.
    • Access Key ID - the key Amazon S3 provided.
    • Secret Access Key - the key Amazon S3 provided.
    • Timeout - 300 seconds (max length just in case).
    I made sure backups was enabled for all my users.

    BTW legacy backup is turned off??? Why? What's the implication?

    I clicked "Save & Validate" i.e. connect to my S3 account. But I can't get the configuration to work. I keep getting an error message. validated failed (see attachment 01)

    I don't know what I am doing wrong???

    Attempt #3 FTP back to my Server Providers "FTP backup storage".

    So I contacted my hosting provider and asked them for help.
    They recommended that I purchase some disk space on their "FTP backup storage" Which I did.
    (£17 pcm. Anyone know how this compares to Amazon S3 price wise???)

    However they said it's for me to perform the FTP backup. (oh the joy!)

    They furnished me with these basic instructions:

    How do I configure scheduled FTP backups in cPanel? | 123-reg

    But I don't understand the caveat at the bottom about having to create an FTP account. (see attachment 02)

    When I emailed my hosting provider for clarification they said I should use FTP from within my server??? (see attachment 03)

    And to follow these instruction

    Connect to FTP/SFTP server which can be accessed via another server only :: WinSCP

    My problem is I have very limited knowledge of FTP. I don't know what to do!

    Question 1

    I watched this video on YouTube which shows how to backup a website:
    youtube.com/watch?v=Xxvn5D7QTFc

    Should I do this for each website on my server before attempting to FTP it off the server?

    Question 2

    Is there a way to backup all the websites in one go from with WHM? Rather than having to back them all up one by one, via each websites cPanel login?

    Question 3

    How do I create the FTP account on the "FTP Backup Storage"? My server provider gave me 3 new credentials:
    1. A hostname
    2. A username
    3. A password
    Do I have to tunnel from my VPS to the FTP backup Storage? If so how? Via WHM? Via PuTTY? Via WinSCP? Anyone?

    Question 4

    Can I use WinSCP to transfer the files directly between the servers? I thought it was meant to be Client-Server and vice versa. My ISP choking my connection means I cant download to my local machine.

    If anyone can help it would really be appreciated.

    Thanks in advance.
     

    Attached Files:

    #1 LordLiverpool, Apr 14, 2016
    Last edited: Apr 14, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,743
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The first step is to configure backups to the remote FTP server via:

    "WHM Home » Backup » Backup Configuration"

    We offer a full document on this at:

    Backup Configuration - Documentation - cPanel Documentation

    Under "Additional Destinations", choose "FTP" as the destination type. Your provider will need to provide you the specific hostname, username, and password for the FTP storage you selected, as any FTP accounts you create on the cPanel server are separate from the remote FTP storage you purchased. Please let us know if any issues persist with this step before we proceed with the next step in this process.

    Thank you.
     
  3. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi @cPanelMichael

    Thanks for replying.

    I think I've just managed to perform my first FTP backup to the remote backup server.

    I opened the cPanel of each website and performed a full backup.
    I got an email each time to say the backup was successful.
    But this just created a tar.gz file in the "home directory" of the website. (The same HDD thats about to fail.)
    Again I realised my ISP would choke my download(s).

    So I then changed the destination to "Remote FTP Server" using the logon credentials given to me today by my web host.
    I took a gamble on the (Passive Mode Transfer) option, whatever passive means in this context???

    I got an email to say the backup was successful.
    When I look in the home directory the 2nd backup or tar.gz isn't present.
    Therefore I can only assume it's been FTP'd over.
    But I don't know how to log on to the backup server to see the actual files because the logon credentials are "unusual".

    (See Attachments)

    Cheers
     

    Attached Files:

    • 01.JPG
      01.JPG
      File size:
      47 KB
      Views:
      3
    • 02.JPG
      02.JPG
      File size:
      96.4 KB
      Views:
      3
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,743
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can find an explanation of this at:

    How to Enable FTP Passive Mode - cPanel Knowledge Base - cPanel Documentation

    You can use a third-party application such as Filezilla:

    https://filezilla-project.org/

    Simply enter the same login details you used when sending the backup to the remote FTP server.

    Thank you.
     
  5. webhostuk

    webhostuk Well-Known Member

    Joined:
    Sep 11, 2013
    Messages:
    54
    Likes Received:
    6
    Trophy Points:
    8
    cPanel Access Level:
    Website Owner
    Even R1soft is a good option if you are looking for remote backup storage.
     
  6. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    @cPanelsMichael

    Thanks once again for replying.

    OK it was simple in the end. (isn't that always the case?)

    I had to log on to my VPS via PuTTY.
    Then from the command line I typed:

    > ftp
    > o
    > [hostname]
    > [username]
    > [password]

    This established a connection to the FTP backup storage.

    I didn't know you could FTP from Server A to Server B. Is this what they call FTP tunneling?

    The result is my backups worked. (phew!!!)
    They are all stored safe and sound on the FTP backup storage.
    And not a moment too soon, because just 30 minutes later my VPS went down!

    Now to fix the VPS, I will leave that to my hosting provider.

    Cheers.
     
  7. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    @webhostuk

    I will look at R1soft pricing.

    Thanks for the tip.
     
  8. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    r1soft is great but don't rely on it 100% ( form experience)
    always have normal backups via cpanel backups or rsync

    although since its last buyout it has worked 100% flawlessly
     
  9. albagarcia

    albagarcia Member

    Joined:
    Mar 11, 2016
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Madrid
    cPanel Access Level:
    DataCenter Provider
    Hello.

    The best option is do backup to sftp or s3 server
     
    #9 albagarcia, Apr 17, 2016
    Last edited by a moderator: Apr 18, 2016
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,743
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I'm happy to see the backups are now working as expected. This is simply a FTP connection and transfer. FTP tunneling is described at:

    FTP Tunneling

    Thank you.
     
  11. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Not quite!

    I got the FTP backup to work

    But I can't get S3 to validate its connection.

    However my hosting provider is experiencing a major incident.
    Some poor soul deleted the contents of every VPS within the datacentre!!!
    Hundreds of Servers.
    Tens of Thousands of websites are offline.

    So I now have two problems. A failed or failing HDD and a completely blank VPS.

    If you don't laugh you'll cry!
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,743
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to reply back to this thread once your VPS is operating again, and we can proceed to troubleshoot the Amazon S3 validation issue (we will need the output from /usr/local/cpanel/logs/cpbackup_transporter.log when the validation fails).

    Thank you.
     
  13. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    @cPanelMichael

    After 18 days my web hosting provider has finally fixed my webserver!!!

    Apparently some poor soul was trying to delete every VPS that was not in the Live Database, but forgot to include the "NOT"
    Over 1 million websites wiped out, including all of mine.

    My other issue was a fault on the disk.
    This morning my hosting provider ran a disk check and that's brought all my websites and emails back up.

    Anyway now it's back I'm very anxious to make an Amazon S3 backup asap.

    I have the output from /usr/local/cpanel/logs/cpbackup_transporter.log

    How should I send it to you? Does it contain sensitive information that's not for this public forum or is it OK to simply attach as a file?

    Best Regards
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,743
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  15. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    @cPanelMichael

    Thanks for the link. I've read that thread.

    So the fix is to: Create a new Amazon account that's in a region (e.g. Ireland) that supports the V2 authorisation???

    Unfortunately there is nothing I can do right now as my webserver is offline again!!!
    As soon as my hosting provider fixes it I will try your suggestion and will report back here.

    Thanks very much.
     
  16. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    @cPanelMichael

    OMG my web server is back! After 23 days!!!

    OK do I need to create a completely new Amazon S3 account???

    Because I created a new bucket in a new region of Ireland and the validation failed.

    See attachments.

    New Bucket.JPG
    Validation Failed.JPG

    Thanks in advance
     
  17. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,743
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Here's a quote from a user on the other thread that's relevant to this case:

    Feel free to open a support ticket using the link in my signature so we can take a closer look if the issue persists.

    Thank you.
     
  18. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Thanks @cPanelMichael I missed that crucial point sorry.
    I will change my keys and report back here.
    Cheers.
     
  19. LordLiverpool

    LordLiverpool Active Member

    Joined:
    Dec 27, 2014
    Messages:
    25
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    OK progress!

    I got the connection to validate:

    validated.JPG

    I followed the instructions on this page:

    Creating an IAM User in Your AWS Account - AWS Identity and Access Management

    For the benefit of others I had to do the following:

    Start here: https://console.aws.amazon.com/iam/home#home
    • Create a user.
    • Create new keys (be sure to download the credentials as a CSV).
    • Create a group.
    • Attach a policy of AdminAccess to the group.
    • Add the user to the group.
    • Gave user a password.
    • Created a new bucket in the region of Ireland.
    • In cPanel > Backup Config - I entered all my new details.
    • Validation succeeded.
    OK I now need to wait until cPanel performs the backup to see if it's truly worked.
    As there is no option in the cPanel Backup Config screen to force a backup.

    Cheers

    Mike.
     
  20. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,743
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You can force a backup generation via the command line if you ever want to test a backup generation manually:

    Code:
    /usr/local/cpanel/bin/backup --force
    Thank you.
     
Loading...

Share This Page