Best Method of backing up to remote in-house server

Edrick Smith

Well-Known Member
Oct 9, 2017
54
6
8
Boston, MA
cPanel Access Level
DataCenter Provider
Most of the threads i can find are older and I'm reviewing to see how relevent still, Being that features have been added though and technology has changed I want to see what I'm missing.

So what I'm curious about is what's the best method of doing cPanel/WHM full backups to say an in-house system.

Example: Having multiple WHM servers in different locations, having an on-site linux based system for storage.

So I suppose two questions in that scenario;

a) Is it best to just open a port to SSH say, allow only firewalled traffic from the remote WHM IP addresses so other systems cant access that SSH port and using WHM backup

b) Is it better to do some type of mounted network share on the system and have WHM just do a backup to a "local" drive that's actually network mounted
If so, I would assume you'd want some type of VPN connectivity as to not be doing a public network share over the internet?

So I guess I'm just curious what you guys are doing in a scenario where you have multiple WHM servers at different locations and want to have a centralized on-site backup.
 
Last edited by a moderator:

wintech2003

Well-Known Member
PartnerNOC
Sep 15, 2010
109
38
78
Greece
cPanel Access Level
DataCenter Provider
Hey there, we're using an on-site Acronis Cyber Infrastructure cluster to perform backups every 6 hours for all our cPanel servers.
Acronis uses a kernel module to track changes in the filesystem, so there's no need to re-calculate the differences between your current files and the last incremental backup, which means there's practically zero load increase during the backup process. This way you can backup how often you want and not only nightly as in other cases.

A cPanel plugin is also available Acronis Backup plugin for WHM & cPanel

Of course, you'll have to consider the cost of the hardware (storage nodes), 10G networking at least for the storage layer (the cluster runs in a HA setup and backups are stored redundant across storage nodes), and license costs, so it really depends on your budget.
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
963
437
363
cPanel Access Level
DataCenter Provider
You have not really given many requirements (other than you want to back up to one centralized server). Are you looking to just back up the cPanel accounts or are you looking for a bare metal solution? If you just want to backup cPanel accounts and only need it done daily, then the backup built into WHM can do that. If you want a backup to run multiple times per day then you can look at something like JetBackup. If you want bare metal recovery, then you've moved into a whole different class (and cost) of software.
 

keat63

Well-Known Member
Nov 20, 2014
1,963
267
113
cPanel Access Level
Root Administrator
I backup our internal system to our whm server, I use psftp app to SFTP a zip file nightly.
Run as a windows sheduled task.
Rather than uploading, I dare say downloading would do the same
 
  • Like
Reactions: Edrick Smith

Edrick Smith

Well-Known Member
Oct 9, 2017
54
6
8
Boston, MA
cPanel Access Level
DataCenter Provider
I suppose more so yes was just thinking per cPanel / WHMs backup mechanism. We run hypervisors on hardware then have cPanel on that. So to do a system level backup I'm doing that at the hypervisor level. But I at least wanted to determine a quick and easy way to backup WHM on a more regular basis. Based on that determining the best way to mount / connect to the remote storage for it. I suppose doing an SFTP transfer would be the easiest / most consistent. Vs trying to do some type of mounted network drive over VPN or something.

What I've done as of now, is setup a linux system on an in-house virtual system and just setup SFTP transfers from WHM built in tool to backup weekly.

Am I correct that in order to say have two scenarios;

Backup 3 times a week locally
Backup to the SFTP destination once a week

That I would need to purchase the paid option it lists? It seems with the built in mechanism as is, I can only set a single type of schedule and it goes both locally and to the remote.

Which is fine, but I was just curious if you wanted to have different backup schedules that doesn't seem to be built in correct?
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
963
437
363
cPanel Access Level
DataCenter Provider
You can do what you want with JetBackup (which is $5.95 / server / month). You'd basically define different backup destinations (local and remote) and then create different backup schedules that use those destinations. It's pretty straight forward and cost effective. The bonus (if you want to enable it) is you can give your clients access to be able to restore things themselves (or just download the backups).
 
  • Like
Reactions: cPRex

Ujins

Member
Jan 13, 2021
6
3
3
NY
cPanel Access Level
Website Owner
I generally use SSH and WP-CLI (and other Linux/Unix command-line tools) for this.

The exact process depends on the site and how it is configured (for example, if the site’s code is stored in git, then you really only need to back up the database and the uploads directory apart from that).

Here is one way to do it though:

# Change to the site's directory
cd ~/public_html # or wherever the site lives
# Archive the site files
# Note you should not make your backups publicly accessible!
tar cvf ~/backups/files-20200227.tar.gz .
# Archive the site database
wp db export - | gzip -c > ~/backups/db-20200227.sql.gz

You can then copy the files over to another server using scp.

Or, you can make the entire process run on another server (using rsync for files, and ssh wp db export ... for the database dump), and then add incremental backups on top of that.

Setting up and maintaining such a backup system using the free, open-source Linux/Unix tools is one of the services I provide for my clients. The “right” solution usually looks a bit different depending on their needs and their server setup.
 
  • Like
Reactions: cPRex

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
963
437
363
cPanel Access Level
DataCenter Provider
The only downside that I can see to the above is that you only have the web site/database. Your not backing up mail (as an example).
 
  • Like
Reactions: cPRex

hafizharis

Registered
Sep 29, 2022
1
0
0
Malaysia
cPanel Access Level
Website Owner
Although this is an old topic but the title could easily help others who are searching for similar solutions. So instead of creating a new thread, i'll just share my method here.
I'm using a free method to do automated remote backup using the WHM/Cpanel UAPI. Using the API, we can run a full cpanel acc backup including the db, files, emails, dns, etc.

1. Setup a remote FTP NAS server.
2. Create a backup http request via api token. This can be schedules using many tools such as n8n (selfhosted) or other automation tools.
3. So when triggered, my n8n will send a backup request to cpanel > cpanel run full acc backup > keep temporarily on home folder > transfer it to my remote ftp > delete local copy.
 

timkah

Member
Sep 28, 2022
16
3
3
United Kingdom
cPanel Access Level
Root Administrator
Although this is an old topic but the title could easily help others who are searching for similar solutions. So instead of creating a new thread, i'll just share my method here.
I'm using a free method to do automated remote backup using the WHM/Cpanel UAPI. Using the API, we can run a full cpanel acc backup including the db, files, emails, dns, etc.

1. Setup a remote FTP NAS server.
2. Create a backup http request via api token. This can be schedules using many tools such as n8n (selfhosted) or other automation tools.
3. So when triggered, my n8n will send a backup request to cpanel > cpanel run full acc backup > keep temporarily on home folder > transfer it to my remote ftp > delete local copy.
IMO it is better to use automated system for backups, like these days you can have a cheap cloud storage service with S3 API and having S3 API means you can just enable/disable backup from WHM with any time interval.