Data loss for websites and applications is one of the biggest disaster scenarios in the digital world. cPanel/WHM It is vital for server administrators to keep backups off-site. This guide includes products known for their cost effectiveness and reliability. Google DriveWe will explain step by step how to integrate it into your WHM server.
1. Basic Concepts
Before starting the installation, it is important to understand the operating logic of the system:
- cPanel: It is the panel where end users (websites) are hosted.
- WHM (WebHost Manager): It is the server administrator's (root) panel and the backup engine is managed from here.
- Additional Destinations: These are the remote destinations (Google Drive, Amazon S3, FTP, etc.) that WHM will copy the backups to after taking them to the local disk.
2. Requirements
- WHM'e Root level access (Reseller authority is not sufficient).
- An active Google account (Preferably G Suite or one with ample storage).
- Google Cloud Console access.
- Your server's hostname must be configured correctly (Ex:
server.ekasunucu.com).
If you don't have a server, high performance Türkiye Location VDS You can review our packages.
3. Google Cloud Console Preparation
In order to use the Google Drive API, we must first create a "Projectctct" on Google and enable the API.
- Google Cloud Console Go to and log in.
- From the project selection menu on the top left "New Projectctct" Click the (New Projectctct) button.
- Projectctct name (Ex:
WHM-Backup-System) and create it by clicking "Create". - From the left menu "APIs & Services" > "Library" Follow your path.
- into the search bar
Google Drive APIwrite. - The result is "Google Drive API" Click and "Enable" Press the (Enable) button.
4. Creating OAuth 2.0 (Client ID & Secret)
We've opened the API, now we'll create credentials so our WHM server can talk securely to Google.
4.1 OAuth Consent Screen
- under the APIs & Services menu "OAuth consent screen" Go to the tab.
- User Type as "External" Select the option and click "Create".
- App Information:
- App name:
WHM Backup - User support email: Your own email.
- Developer contact email: Your own email.
- App name:
- Test Users (Very Important): Click the "Add Users" button and add the Google account email to which you will upload the backup. If you do not do this, you will receive an error on the authorization screen.
4.2 OAuth Client ID Creation
- From the left menu "Credentials" Go to the tab.
- "Create Credentials" pressing the button "OAuth Client ID" Select the option.
- Application Type: Select "Web application".
- Authorized Redirect URI (Critical Step): You must enter your server's callback address here. The format is as follows:
https://HOSTNAME:2087/googledriveauth/callback
# Example:
https://server.alanadiniz.com:2087/googledriveauth/callback
Make a note of the Client ID and Client Secret values. The Secret is only shown once!
5. WHM – Creating Google Drive Destination
Now with the credentials we have, we can connect the server to Google.
- Log in to WHM panel as root.
- in the search box
Backup Configurationtype and enter. - Additional Destinations Switch to the tab.
- Destination Type from the list "Google Drive" Select it and say "Create new destination".
- Fill in the information below:
- Name:
GoogleDrive-Yedek(You can give any name you want). - Folder:
whm-backups(Folder name to create in Drive). - Client ID: The ID you received from Google.
- Client Secret: Secret you got from Google.
- Timeout: Default value (usually sufficient, can be increased for large backups).
- Name:
- "Generate Credentials" Click the button. In the window that opens, select your Google account and allow it.
- When the verification is successful, the token will automatically be filled into the box.
6. Backup Settings (Actual Backup Rules)
Now let's determine the frequency and content of the backup. Go to WHM > Backup Configuration > Backup Settings tab.
6.1 Genel Ayarlar
- Backup Status: Enable.
- Backup Type: Compressed. This option saves disk space and shortens upload time.
6.2 Scheduling
Choose a strategy according to your data density:
- Daily: For critical sites. You can set the "Retention" period to 3-7 days.
- Weekly: on Sundays. Retention: 4 weeks (1 months retroactive reserve).
- Monthly: 1 of the month. Retention: 1-3 months.
6.3 Files and Databases
- Select Backup Files:
- Back up User Accounts: On (User data).
- Back up System Files: Usually kept closed (Server configuration). It takes up a lot of space.
- Databases: We recommend the "Per Account" option. This is a separate database for each site.
.sqlfile into the backup, making restoring easier.
7. Working Logic (Very Important)
Understanding how the system works prevents disk full problems. WHM Google Drive backup works in this order:
- The backup process begins.
- cPanel first saves the backup on the server's local disk (usually
/backup/tmpor/home/backup) and compresses (.tar.gz). - The resulting file is uploaded to the cloud via Google Drive API.
- "Retain backups in the default backup directory" option OFF If so, the file on the local disk is deleted after the upload is successful.
Therefore, your server must have at least as much free space (temp space) as your largest site.
8. Manual Testing and SSH
You can manually trigger via SSH to test whether the system is working without waiting for the scheduled task.
/usr/local/cpanel/bin/backup --force
# Follow the transaction from live logs:
tail -f /usr/local/cpanel/logs/cpbackup/*.log
9. Troubleshooting
Common errors you may encounter and their solutions:
https:// protocol and :2087 Pay attention to the port. Use hostname instead of IP address. 10. Frequently Asked Questions
We have compiled the most frequently asked questions from our users about this topic.
Q: What happens if my Drive space runs out?
A: The backup will fail and you will receive an error email. Although WHM tries to delete old backups (according to the Retention setting), having a full Drive trash can sometimes cause problems. Check the drive area regularly.
Q: How do I restore from backup?
C: From the WHM > "Restore a Full Backup/cpmove File" menu. If the file is not on the server, first download it from Drive to your computer, then transfer it to the server. /home or /backup directory and start the restore process.
Q: Can I add multiple Drive accounts?
A: Yes, you can add multiple destinations from the Additional Destinations section. For example, you can backup to both Google Drive and local disk at the same time.
Q: Does this process slow down the server?
A: The backup process (especially the compression phase) uses CPU and I/O. Therefore, it is recommended that you schedule backups at night when server traffic is least (e.g. 03:00).
Do You Want Professional Support?
Eka Sunucu technical team 7/24 is with you regarding backup configurations, server optimization and security settings.
Contact Us