{"id":3536,"date":"2016-02-27T21:32:58","date_gmt":"2016-02-28T02:32:58","guid":{"rendered":"http:\/\/underhost.com\/blog\/?p=3536"},"modified":"2026-10-23T09:50:50","modified_gmt":"2026-10-23T13:50:50","slug":"automatic-cpanel-backup-domain-mysql-with-cron-php","status":"publish","type":"post","link":"https:\/\/underhost.com\/blog\/automatic-cpanel-backup-domain-mysql-with-cron-php\/","title":{"rendered":"Automatic cPanel Backups: How to Schedule Them Safely (WHM, cPanel and Cron)"},"content":{"rendered":"<div class=\"uh-blog-hero\" style=\"margin:0 0 40px;text-align:center;padding:48px 24px;border-radius:20px;background:linear-gradient(135deg,#0D1F3C 0%,#125A8A 58%,#176EA5 100%);color:#ffffff;box-shadow:0 20px 40px -15px rgba(13,31,60,0.28);position:relative;overflow:hidden;\">\n<div style=\"display:inline-flex;align-items:center;gap:8px;padding:7px 14px;margin-bottom:16px;border:1px solid rgba(0,212,255,0.32);border-radius:999px;color:#DFF8FF;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:rgba(0,212,255,0.10);\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> Backups<\/div>\n<h1 style=\"color:#ffffff;font-size:clamp(32px,5vw,46px);line-height:1.12;margin:0 0 14px;font-weight:800;\">Automatic cPanel Backups: How to Schedule Them Safely (WHM, cPanel and Cron)<\/h1>\n<\/div>\n<div class=\"uh-blog-excerpt\" style=\"border-left:4px solid #00D4FF;padding:18px 20px;margin:0 0 34px;background:#F8FAFC;color:#1F2937;border-radius:0 14px 14px 0;box-shadow:0 8px 28px rgba(13,31,60,0.08);line-height:1.75;\"><strong style=\"color:#0D1F3C;\">Short answer:<\/strong> If you manage the server, turn on backups in <strong>WHM &gt; Backup &gt; Backup Configuration<\/strong>: pick a schedule, a retention period and an off-site destination, and cPanel runs them automatically. If you only have a cPanel account, schedule a full backup with a cron job that calls cPanel&#8217;s Backup API and sends the file to another server over SSH with a key. Never put passwords in cron jobs or scripts, and test a restore regularly.<\/div>\n<nav aria-label=\"Table of contents\" class=\"uh-toc\" style=\"background:#ffffff;border:1px solid #E5E7EB;border-radius:16px;padding:20px 22px;margin:0 0 34px;box-shadow:0 4px 12px rgba(13,31,60,0.08);\">\n<div style=\"font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#176EA5;margin-bottom:10px;\"><i class=\"fas fa-list\" style=\"color:#00D4FF;\"><\/i> In this guide<\/div>\n<ol style=\"margin:0;padding-left:20px;columns:2 260px;column-gap:28px;line-height:1.9;\">\n<li><a href=\"#what-a-good-backup-setup-looks-like\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">What a good backup setup looks like<\/a><\/li>\n<li><a href=\"#option-1-server-wide-backups-in-whm-recommended\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Option 1: server-wide backups in WHM (recommended)<\/a><\/li>\n<li><a href=\"#option-2-account-level-backups-from-cpanel\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Option 2: account-level backups from cPanel<\/a><\/li>\n<li><a href=\"#option-3-schedule-account-backups-with-cron-no-p\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Option 3: schedule account backups with cron (no passwords)<\/a><\/li>\n<li><a href=\"#what-cpanel-backups-do-not-include\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">What cPanel backups do not include<\/a><\/li>\n<li><a href=\"#how-long-to-keep-backups\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">How long to keep backups<\/a><\/li>\n<li><a href=\"#test-a-restore\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Test a restore<\/a><\/li>\n<li><a href=\"#troubleshooting\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Troubleshooting<\/a><\/li>\n<\/ol>\n<\/nav>\n<div class=\"uh-post-content\" style=\"color:#1F2937;font-size:16px;line-height:1.75;\">\n<h2 id=\"what-a-good-backup-setup-looks-like\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> What a good backup setup looks like<\/h2>\n<ul style=\"list-style:none;padding-left:0;\">\n<li style=\"margin:0 0 8px;\">\u2713 <strong>Automatic:<\/strong> backups run on a schedule, without anyone remembering to start them.<\/li>\n<li style=\"margin:0 0 8px;\">\u2713 <strong>Off-site:<\/strong> at least one copy lives on a different server or storage service.<\/li>\n<li style=\"margin:0 0 8px;\">\u2713 <strong>Kept long enough:<\/strong> you keep several days or weeks, so you can go back before a problem started.<\/li>\n<li style=\"margin:0 0 8px;\">\u2713 <strong>Tested:<\/strong> you have restored from a backup at least once, and you know it works.<\/li>\n<li style=\"margin:0 0 8px;\">\u2713 <strong>Secure:<\/strong> no plain-text passwords in scripts, and backups are not reachable from the web.<\/li>\n<\/ul>\n<h2 id=\"option-1-server-wide-backups-in-whm-recommended\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> Option 1: server-wide backups in WHM (recommended)<\/h2>\n<p style=\"margin:0 0 18px;\">If you have root access to WHM, this is the most reliable method. It backs up every account, including files, databases, email and settings.<\/p>\n<ol style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\">Log in to WHM as root.<\/li>\n<li style=\"margin:0 0 8px;\">Go to <strong>Backup &gt; Backup Configuration<\/strong> and turn on <strong>Enable Backups<\/strong>.<\/li>\n<li style=\"margin:0 0 8px;\">Choose the backup type. <strong>Compressed<\/strong> saves the most space. <strong>Incremental<\/strong> is faster after the first run but cannot be sent to every destination.<\/li>\n<li style=\"margin:0 0 8px;\">Set the schedule (daily, weekly or monthly) and how many copies to keep.<\/li>\n<li style=\"margin:0 0 8px;\">Under <strong>Files<\/strong>, back up user accounts and, if you want, system files.<\/li>\n<li style=\"margin:0 0 8px;\">Under <strong>Databases<\/strong>, choose to back up databases per account, the whole MySQL folder, or both.<\/li>\n<li style=\"margin:0 0 8px;\">Under <strong>Additional Destinations<\/strong>, add an off-site destination, such as SFTP, an S3-compatible storage service, or another backup server. Use the <strong>Validate<\/strong> button to test it.<\/li>\n<li style=\"margin:0 0 8px;\">Save the configuration.<\/li>\n<\/ol>\n<p style=\"margin:0 0 18px;\">To start a backup straight away instead of waiting for the schedule, run this as root:<\/p>\n<pre style=\"background:#0D1F3C;color:#EAF6FF;padding:18px 20px;border-radius:14px;overflow-x:auto;line-height:1.7;font-size:15px;\"><code>\/usr\/local\/cpanel\/bin\/backup --force<\/code><\/pre>\n<p style=\"margin:0 0 18px;\">Backup logs are in <code>\/usr\/local\/cpanel\/logs\/cpbackup\/<\/code>. Check them after the first run, and set up a WHM notification so you hear about failures.<\/p>\n<h2 id=\"option-2-account-level-backups-from-cpanel\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> Option 2: account-level backups from cPanel<\/h2>\n<p style=\"margin:0 0 18px;\">Without root access, you can still back up your own account. In cPanel, open <strong>Files &gt; Backup<\/strong> or the <strong>Backup Wizard<\/strong>. You can download a full backup, or partial backups of your home folder, databases and email forwarders and filters.<\/p>\n<p style=\"margin:0 0 18px;\">Full backups can only be restored by the server administrator, while partial backups can be restored from the same page. Keep both if you want the most options.<\/p>\n<h2 id=\"option-3-schedule-account-backups-with-cron-no-p\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> Option 3: schedule account backups with cron (no passwords)<\/h2>\n<p style=\"margin:0 0 18px;\">cPanel&#8217;s Backup API can create a full account backup from a cron job. Send it to another server with an SSH key, not a password, so no secret is stored in the cron line.<\/p>\n<h3 style=\"color:#0D1F3C;font-size:21px;line-height:1.3;margin:26px 0 10px;\">Step 1: create an SSH key for backups<\/h3>\n<p style=\"margin:0 0 18px;\">In cPanel, open <strong>Security &gt; SSH Access &gt; Manage SSH Keys<\/strong> and generate a key. Add the public key to the backup user on the destination server. Give that user access only to its backup folder.<\/p>\n<h3 style=\"color:#0D1F3C;font-size:21px;line-height:1.3;margin:26px 0 10px;\">Step 2: add the cron job<\/h3>\n<p style=\"margin:0 0 18px;\">In cPanel, open <strong>Advanced &gt; Cron Jobs<\/strong> and add a job, for example daily at 3:30. Replace the host, user, key name and folder with your own:<\/p>\n<pre style=\"background:#0D1F3C;color:#EAF6FF;padding:18px 20px;border-radius:14px;overflow-x:auto;line-height:1.7;font-size:15px;\"><code>uapi Backup fullbackup_to_scp_with_key host=backup.example.com username=backupuser key_name=backupkey directory=\/backups\/myaccount email=you@example.com<\/code><\/pre>\n<p style=\"margin:0 0 18px;\">cPanel sends an email to the address you set when the backup finishes, so you know whether it worked. To keep a copy in your home folder instead, use <code>uapi Backup fullbackup_to_homedir<\/code>, but remember that a copy on the same server does not protect you if the server fails.<\/p>\n<div style=\"background:#FFF7ED;border:1px solid #FDBA74;border-radius:16px;padding:20px 22px;margin:24px 0;\">\n<h3 style=\"margin:0 0 10px;color:#9A3412;font-size:20px;\"><i class=\"fas fa-exclamation-triangle\" style=\"color:#F97316;\"><\/i> Do not do this:<\/h3>\n<p style=\"margin:0;color:#7C2D12;line-height:1.7;\">scripts that log in with your cPanel password, or FTP passwords written in a cron job or a PHP file. Anyone who reads the file gets your account. Use SSH keys or WHM backups instead.<\/p>\n<\/div>\n<h2 id=\"what-cpanel-backups-do-not-include\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> What cPanel backups do not include<\/h2>\n<p style=\"margin:0 0 18px;\">Account backups cover what lives inside the cPanel account. They do not cover everything on the server:<\/p>\n<ul style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\">Databases outside MySQL or MariaDB, such as MongoDB or Redis data. Back these up with their own tools.<\/li>\n<li style=\"margin:0 0 8px;\">Custom server settings, such as hand-edited Apache, PHP or firewall configuration, unless you also back up system files.<\/li>\n<li style=\"margin:0 0 8px;\">Files stored outside the account&#8217;s home folder.<\/li>\n<\/ul>\n<p style=\"margin:0 0 18px;\">List anything else your sites depend on, and add it to your backup plan.<\/p>\n<h2 id=\"how-long-to-keep-backups\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> How long to keep backups<\/h2>\n<div style=\"overflow-x:auto;margin:26px 0;border:1px solid #E5E7EB;border-radius:14px;-webkit-overflow-scrolling:touch;\">\n<table style=\"width:100%;border-collapse:collapse;background:#ffffff;color:#1F2937;font-size:15px;line-height:1.55;margin:0;min-width:600px;\">\n<thead>\n<tr style=\"background:#0D1F3C;color:#fff;\">\n<th style=\"padding:14px;text-align:left;\">Site type<\/th>\n<th style=\"padding:14px;text-align:left;\">Suggested schedule<\/th>\n<th style=\"padding:14px;text-align:left;\">Suggested retention<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Brochure site that rarely changes<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Weekly<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">4 to 8 weeks<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Blog or business site<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Daily<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">14 to 30 days<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Online store or busy database<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Daily, plus database dumps during the day<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">30 days or more<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p style=\"margin:0 0 18px;\">Keep at least one older copy as well. Malware and data errors are often noticed days after they happen, so a backup from last night may already contain the problem.<\/p>\n<h2 id=\"test-a-restore\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> Test a restore<\/h2>\n<p style=\"margin:0 0 18px;\">A backup you have never restored is a guess. At least once a quarter:<\/p>\n<ol style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\">Restore one account or one database to a test location, not over the live site.<\/li>\n<li style=\"margin:0 0 8px;\">Check that the site loads and recent data is there.<\/li>\n<li style=\"margin:0 0 8px;\">Write down how long it took, so you know what to expect in a real emergency.<\/li>\n<\/ol>\n<p style=\"margin:0 0 18px;\">Administrators can restore accounts in <strong>WHM &gt; Backup &gt; Backup Restoration<\/strong>, or single files in <strong>File and Directory Restoration<\/strong>. For command-line restores, see our guide to <a href=\"https:\/\/underhost.com\/blog\/cpanel-backup-and-restore-a-domain-account-via-ssh\/\">backing up and restoring a cPanel account over SSH<\/a>.<\/p>\n<h2 id=\"troubleshooting\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-exclamation-triangle\" style=\"color:#00D4FF;\"><\/i> Troubleshooting<\/h2>\n<div style=\"overflow-x:auto;margin:26px 0;border:1px solid #E5E7EB;border-radius:14px;-webkit-overflow-scrolling:touch;\">\n<table style=\"width:100%;border-collapse:collapse;background:#ffffff;color:#1F2937;font-size:15px;line-height:1.55;margin:0;min-width:600px;\">\n<thead>\n<tr style=\"background:#0D1F3C;color:#fff;\">\n<th style=\"padding:14px;text-align:left;\">Problem<\/th>\n<th style=\"padding:14px;text-align:left;\">Likely cause<\/th>\n<th style=\"padding:14px;text-align:left;\">Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Backups stop when the disk is nearly full<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">cPanel skips backups when free space is low<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Free up space, use compressed backups, or send backups to a remote destination only.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Remote destination fails validation<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Wrong credentials, a firewall, or a closed port<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Check the login details and that the destination allows connections from your server&#8217;s IP address.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">The cron backup never arrives<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">The SSH key is not authorised on the destination<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Test the key with a manual SSH login, then check the cron email for errors.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Backups take hours<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Large accounts, or many accounts in one run<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Use incremental backups, or exclude cache folders and old logs.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p style=\"margin:0 0 18px;\">For more on protecting your data, see our <a href=\"https:\/\/underhost.com\/blog\/automated-cpanel-backup-script-using-cpanel-api\/\">guide to off-site cPanel backups<\/a> and <a href=\"https:\/\/underhost.com\/blog\/cpanel-backup-via-ssh-single-account\/\">creating account backups over SSH<\/a>.<\/p>\n<div aria-hidden=\"true\" class=\"uh-section-divider\" style=\"width:min(100% - 32px, 1080px);margin:44px auto;display:grid;grid-template-columns:1fr 32px 1fr;align-items:center;gap:18px;pointer-events:none;\"><span style=\"height:1px;background:linear-gradient(90deg,transparent,rgba(0,212,255,0.40),rgba(23,110,165,0.24),transparent);\"><\/span><img alt=\"\" decoding=\"async\" height=\"32\" loading=\"lazy\" src=\"https:\/\/cdn.underhost.com\/android-chrome-192x192.webp\" style=\"width:32px;height:32px;display:block;border-radius:8px;filter:drop-shadow(0 0 14px rgba(0,212,255,0.30));\" width=\"32\"\/><span style=\"height:1px;background:linear-gradient(90deg,transparent,rgba(23,110,165,0.24),rgba(0,212,255,0.40),transparent);\"><\/span><\/div>\n<\/div>\n<div class=\"uh-blog-cta\" style=\"background:linear-gradient(135deg,#0D1F3C 0%,#125A8A 58%,#176EA5 100%);color:#ffffff;padding:36px 24px;border-radius:20px;text-align:center;margin:44px 0;box-shadow:0 20px 40px -15px rgba(13,31,60,0.32);\">\n<h2 style=\"margin:0 0 12px;font-size:28px;line-height:1.25;color:#ffffff;\">Need help with this?<\/h2>\n<p style=\"font-size:17px;margin:0 auto 22px;color:#EAF6FF;max-width:720px;line-height:1.7;\">Want off-site backups without managing them yourself? UnderHost backup plans store copies on separate infrastructure, with SSH and RSYNC access.<\/p>\n<p><a href=\"https:\/\/underhost.com\/backup.php\" style=\"background:linear-gradient(90deg,#00D4FF,#0077FF);color:#ffffff;padding:13px 28px;border-radius:10px;text-decoration:none;font-weight:800;display:inline-block;margin:8px;\">See backup plans<\/a><a href=\"https:\/\/customerpanel.ca\/client\/\" style=\"background:transparent;color:#ffffff;padding:12px 28px;border-radius:10px;text-decoration:none;font-weight:800;display:inline-block;margin:8px;border:1px solid rgba(255,255,255,0.32);\">Contact @CustomerPanel<\/a><\/div>\n<div class=\"uh-faq-section\" id=\"faq\" style=\"margin:34px 0;scroll-margin-top:90px;\">\n<h2 style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:0 0 18px;border-bottom:2px solid rgba(0,212,255,0.22);padding-bottom:10px;\">Frequently asked questions<\/h2>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">Does WHM back up databases and email?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">Yes. WHM account backups include files, databases, email and account settings, as long as accounts and databases are selected in Backup Configuration.<\/p>\n<\/div>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">Is a backup on the same server enough?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">No. If the server fails or is compromised, local backups can be lost too. Keep at least one copy on another server or storage service.<\/p>\n<\/div>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">How do I back up a cPanel account without root access?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">Use Files &gt; Backup in cPanel to download a backup, or schedule the Backup API with a cron job that sends the backup to another server with an SSH key.<\/p>\n<\/div>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">How often should I test a restore?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">At least once a quarter, and after any change to your backup setup. Restore to a test location so the live site is not affected.<\/p>\n<\/div>\n<\/div>\n<p><!-- uh-related-start --><\/p>\n<div style=\"background:#F4F8FC;border:1px solid #DCE7F3;border-radius:14px;padding:18px 22px;margin:32px 0 8px;\">\n<h2 style=\"margin:0 0 12px;font-size:22px;\">Related guides<\/h2>\n<ul style=\"margin:0;padding-left:20px;\">\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/cpanel-backup-and-restore-a-domain-account-via-ssh\/\">How to Back Up and Restore a cPanel Account Over SSH<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/automated-cpanel-backup-script-using-cpanel-api\/\">Automating cPanel Backups: Off-Site Options and Safer Methods<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/cpanel-backup-via-ssh-single-account\/\">How to Create and Store a cPanel Account Backup Over SSH<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/cpanel-tutorial-domains-parked-domains\/\">cPanel Tutorial: Domains &#8211; Parked Domains<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/cpanel-tutorial-domains-addon-domains\/\">cPanel Tutorial: Domains &#8211; Addon Domains<\/a><\/li>\n<\/ul>\n<\/div>\n<p><!-- uh-related-end --><br \/>\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Does WHM back up databases and email?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. WHM account backups include files, databases, email and account settings, as long as accounts and databases are selected in Backup Configuration.\"}}, {\"@type\": \"Question\", \"name\": \"Is a backup on the same server enough?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. If the server fails or is compromised, local backups can be lost too. Keep at least one copy on another server or storage service.\"}}, {\"@type\": \"Question\", \"name\": \"How do I back up a cPanel account without root access?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Use Files > Backup in cPanel to download a backup, or schedule the Backup API with a cron job that sends the backup to another server with an SSH key.\"}}, {\"@type\": \"Question\", \"name\": \"How often should I test a restore?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"At least once a quarter, and after any change to your backup setup. Restore to a test location so the live site is not affected.\"}}]}<\/script><\/p>\n<h2 id=\"sources\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-book\" style=\"color:#00D4FF;\"><\/i> Sources<\/h2>\n<ul style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/docs.cpanel.net\/whm\/backup\/backup-configuration\/\">cPanel documentation: Backup Configuration<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/docs.cpanel.net\/cpanel\/files\/backup-wizard\/\">cPanel documentation: Backup Wizard<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/api.docs.cpanel.net\/openapi\/cpanel\/operation\/fullbackup_to_scp_with_key\/\">cPanel API: Backup::fullbackup_to_scp_with_key<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>If you manage the server, turn on backups in WHM > Backup > Backup Configuration: pick a schedule, a retention period and an off-site destination, and cPanel runs them automatically. If you only have a cPanel account, schedule a full backup with a cron job that calls cPanel&#8217;s Backup API and sends the file to another server over SSH with a key. Never put passwords in cron jobs or scripts, and test a restore regularly.<\/p>\n","protected":false},"author":1,"featured_media":302,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54,202,82],"tags":[125,108,123,109],"class_list":["post-3536","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backups","category-cpanel-whm","category-domains-dns","tag-tag-backups","tag-tag-cpanel","tag-tag-domains","tag-tag-whm"],"_links":{"self":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/comments?post=3536"}],"version-history":[{"count":17,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3536\/revisions"}],"predecessor-version":[{"id":7008,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3536\/revisions\/7008"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media\/302"}],"wp:attachment":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media?parent=3536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/categories?post=3536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/tags?post=3536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}