In this article, we will show you how to backup your HostGator VPS or Dedicated Server website. For instructions on how to add multiple websites from different cPanel accounts, please see this support article.
In order to backup your HostGator VPS or Dedicated Server website, we will need several pieces of information
Step 1: Log into your WHM account.
If you're not sure how to access your WHM account, HostGator will be able to assist you.
When you visit your WHM URL, you may see this screen:
Click the "Advanced" link (above) and then the "Proceed" link (below).
Next, enter your WHM login credentials and click "Log In"
Step 2: Gather Website URL, SFTP IP Address, and SFTP Username
In the top left of your WHM panel, you will find a search bar. Enter "List Accounts" in the search bar, and under the "Account Information" heading, you will click "List Accounts".
You will then see a screen that looks like this:
On this screen, you will find your website URL (a), SFTP IP Address (b), and SFTP Username (c)
Step 3: Gather the File Content Path
Back on the homepage of your cPanel, you will find the cPanel home directory under "General Information". This is usually on the left or right side of the main cPanel content area.
Your File Content Path will be the cPanel home directory plus "/public_html", so in this case, it will be "/home/ dgwhmcredstest /public_html"
Step 5: Log into your CodeGuard account and add your site
Log into your CodeGuard account by visiting https://codeguard.com/login. Enter your username and password and click "Log In"
If you haven't added any sites yet, your screen will look the same as below. Click "Add FTP/SFTP Website". This button will be below your Backup Success Graphs if you already have websites added.
This next page is where you will enter your SFTP credentials. The first field is where you will enter your URL. The second will be your SFTP IP Address, and the third is for your SFTP Username. Also, be sure that "SFTP" is selected. Leave the password field blank and click "add our public key to your server".
The public key field will then appear. Copy the public key here then go back to your cPanel.
Back in your cPanel, scroll down to the Security section and click on the "SSH Access" icon
Click "Manage SSH Keys
Click "Import Key"
Here you will choose a name for your public key. We recommend 'id_rsa_cg' so that you know it is related to your CodeGuard account and you don't accidentally delete it. Then paste the key from your CodeGuard website addition screen into the bottom field and click "Import".
Click "Back to Manage Keys"
Next, you will need to authorize your key. Click "Manage" next to your newly imported key.
Now, go back to your CodeGuard account and click "Test Website Connection". Upon successful connection, you will then be prompted to select your root directory. You will want to choose the path that you found previously (d). Click the checkbox next to your root directory and click "Select Root Directory".
Your screen will automatically scroll down to the field to select your files to be backed up. Selecting the top directory will automatically select everything inside your root folder. You can then go through and uncheck any files or folders that you do not need backed up such as log, temporary or cache files. Once you've chosen all of the files to be backed up, click "Begin First Backup"
You will then be prompted to either add your database or visit the dashboard. If you are ready to add your database, go ahead and click "Add Database Now". Since that is a topic for a different support article, we will click "Go To Dashboard".
On your website's dashboard, you will see the backup progress tracker. You can follow the steps in this tracker while your website is being backed up. You will also receive an email notifying you when the backup is complete, so it's not necessary to sit and watch the tracker.
When the backup is done, you can close the progress tracker. You will now see your website has been added successfully, and the first backup will show on your website dashboard.
Congratulations! You've successfully added your website! If you ran into any trouble at any point in this process, we have fast and friendly support representatives available by contacting CodeGuard Support.