Web Hosting Knowledge Base Web Hosting Knowledge Base
  • Home
Get Started
Web Hosting Knowledge Base Web Hosting Knowledge Base
Get Started
Web Hosting Knowledge Base Web Hosting Knowledge Base
  • Home
loading
  1. Home
  2. Getting Started
  3. Hostvento Hosting's Getting Started Guide
  4. Backing up your data
  5. How to use Google Drive to back up and restore data
Updated on June 22, 2024

Getting Started

  • Folder icon closed Folder open iconShared Hosting Quick Start Guide
    • How to Change Nameservers in GoDaddy?
    • CloudLinux monitoring and limits
    • How to Create/Edit/Delete User Package with DirectAdmin?
    • How to Change the Time-zone in Webmail?
    • How to Add Email Filters from Webmail?
    • How to Claim Your Free .online Domain at Hostvento?
    • Managed WordPress Quick Start Guide
      • How to Update WordPress Installation?
      • How to Install WordPress Locally on Windows?
    • ProcessWire CMS
    • How to Buy Hosting from hostvento
    • Discover the Steps to Change a Password in Linux
    • How to change Domain Nameservers (DNS) of my Domain?
    • IP Deny Manager
    • What is SSH2 and how to install it
    • How to install eAccelerator on linux cPanel server ?
    • Do you support Magento eCommerce website
    • Discover the PHP Error Messages That Web Designers Should Know About
    • Learn to Use the Group Block in WordPress
    • How to determine the WordPress Version?
    • Learn to monitor blacklisted sites using Dropmysite
    • What is cPanel Hosting: A Complete Guide
    • How To Change The WordPress Auto-Save Interval?
    • Steps to Perform When the phprc File Isn’t Updating
    • How To Install Elgg Through Softaculous?
    • Steps to Redirect URLs Using Nginx
    • Using SMTP authentication to send email through WordPress
    • How To Configure The Display Options Of WooCommerce?
    • When Will Softaculous Provide With The Latest Version Of A Script/Application?
    • Know How To Set Constant FS_Method
    • How to Find Out the Latest Visitors to Your Website in cPanel?
    • How to Copy or Move Files in cPanel File Manager?
    • What Is a Parked(Alias) Domain and How Do I Set up One
    • Discover the Steps to Change a Password in Linux
    • How To Manage User Roles In Plesk?
    • How To Suspend And Unsuspend Accounts In WHM?
    • How to Connect to MySQL Using Python?
    • How To Change The Logo Of Your AbanteCart Store?
    • How To Create Custom Email Filters In cPanel?
    • How Do I Debug Magento MySQL Problems?
    • How to Add and Delete Email Account in Webuzo?
    • How to Add and Delete Email Account in Webuzo?
    • How to Add and Delete Email Account in Webuzo?
    • Learn to access phpMyAdmin and phpPgAdmin in cPanel
    • How to Restart a Server using Plesk?
    • SMF Hosting FAQ
    • Enable HTML files to display PHP Code
    • How to change your Plesk Password?
    • How to Check the Commission Status from Hostvento Affiliate Dashboard?
  • Folder icon closed Folder open iconUnmanaged VPS Quick Start Guide
  • Folder icon closed Folder open iconReseller Quick Start Guide
  • Folder icon closed Folder open iconUnmanaged Dedicated Server Quick Start Guide
  • Folder icon closed Folder open iconOrdering a hosting package
  • Folder icon closed Folder open iconHow to help secure your website
    • How To Secure Your Website's Software
  • Folder icon closed Folder open iconHostvento Hosting's Getting Started Guide
    • How to use the Knowledge Base
    • Shared Hosting Quick Start Guide
    • Managed WordPress Quick Start Guide
    • Reseller Quick Start Guide
    • Managed Dedicated Server Quick Start Guide
    • Unmanaged Dedicated Server Quick Start Guide
    • Ordering a hosting package
      • How to order a shared web hosting package
      • How to order a reseller hosting package
      • How to order an unmanaged Dedicated Server
      • How to order a managed Dedicated Server
      • How to use Hostvento Hosting coupons and discounts
    • Registering a domain
      • How to choose an effective domain name
      • How to protect your domain name
      • How to register and use internationalized domain names (IDNs)
      • .us Domain Name & Nexus Requirements Guide
      • Requirements for registering Canadian .ca domain names
      • Reactivating an expired domain
      • Validating your domain with ICANN
    • Configuring domain settings
      • Introduction to domain names and DNS
      • How to update the nameservers at third-party registrars
      • How to transfer a domain to Hostvento Hosting
      • How to set the name servers for a domain to point to Hostvento Hosting
      • How to access your web site before DNS propagation is complete
      • How to configure custom name servers
      • How to configure reverse DNS
      • How to set the name servers for a domain at OpenSRS
      • How to set the name servers for a domain registered at GoDaddy
      • How to change your account's primary domain name
      • How to use shared URLs to access your site
      • How to add an SRV record to a domain
      • How to use Anycast DNS with a web hosting account
      • What are subdomains, addon domains, and parked domains?
      • What are wildcard subdomains?
      • How to find the IP address for your hosting account
      • How to configure a .dk hosted custom name server
      • How to check a domain's automatic renewal status
      • How to verify site ownership with Google
      • What is a DNS TXT record?
    • Accessing your account
      • Accessing your hosting control panel
      • How to use SSH (Secure Shell) on Windows and Mac to access your account
      • How to access your account using SSH keys
      • Using FTP (File Transfer Protocol)
      • How to use Secure Copy Protocol(SCP) to transfer files securely on Windows and Mac
      • How to set up SFTP access for multiple users
      • How to use SSHFS (Secure Shell Filesystem)
      • How to use the SolusVM control panel to administer an unmanaged VPS
      • How to disable SSH logins for the root account
      • How to enable two-factor authentication for SSH
      • Warning message when you try to connect to a server using SSH
      • How to keep SSH connections alive
      • 'Output truncated' message when you try to list files using FTP
      • FTP accounts do not work after FileZilla upgrade
      • 'Too many connections from this IP' error message
      • How to change the SSH server port number
      • How to use FTP with Linux hosting accounts
    • How to set up e-mail for your web site
      • Configuring and accessing your e-mail
      • How to troubleshoot e-mail access problems
      • How to add signatures to webmail
      • An introduction to e-mail protocols
      • Accessing e-mail accounts through webmail
      • How to access e-mail accounts with client applications
      • How to troubleshoot e-mail accounts
      • E-mail client application setup
      • Messages are not copied to the Sent folder when using IMAP
      • How to view e-mail message headers
      • Using external SMTP servers to send e-mail
      • How to troubleshoot Apple (Mac) Mail
      • How to securely monitor e-mail using MailChannels
      • Using a catch-all e-mail address
    • How to migrate your data to Hostvento Hosting
      • Migrating an account from another web host
      • How to migrate e-mail from another host to Hostvento Hosting
      • Differences between site migrations and domain transfers
      • What is included and not included in cPanel migrations?
    • Backing up your data
      • How to back up data on shared hosting and reseller accounts
      • How to use Amazon S3 to back up and restore data
      • How to use Hostvento Cloud Backup
      • How to create e-mail backups
      • How to use Google Drive to back up and restore data
    • How to publish your web site
      • How to create and publish a site with the Hostvento Website Builder
      • How to publish your web site with Sandvox
      • How to publish your website with WebSite X5
      • How to publish your web pages with Google Web Designer
      • How to publish your web site with HTML-Kit
      • How to publish your web site with iWeb
      • How to publish your web site with Web Architect
      • How to publish your web site with PageBreeze
      • How to publish your web site with Dreamweaver
      • How to publish your web site with Web Easy Professional
      • How to publish your web site with Seamonkey
      • How to publish your web site with RapidWeaver
      • How to publish your web site with 90 Second Website Builder
      • How to publish your web site with Microsoft FrontPage
      • How to publish and edit files with UltraEdit
      • How to publish your web site with NetObjects Fusion
      • How to publish your web site with Freeway
      • How to publish and edit files with Sublime Text
      • How to publish your web site with Muse
    • Working with Linux
      • Introduction to Linux commands
      • How to work with compressed files on Microsoft Windows
      • How to edit text files from the command line
      • How to edit .htaccess files
      • How to compress files using cPanel or the command line
    • Internet and networking information
      • How to clear a web browser's cache and cookies
      • How to clear the DNS cache on your computer
      • How to clear the SSL state in a browser
      • Introduction to network troubleshooting
      • How to troubleshoot network connectivity using ping and traceroute
      • How to test DNS with dig and nslookup
      • How to troubleshoot network applications with telnet
      • How to troubleshoot SSL connections with the openssl program
      • Web pages display incorrectly on mobile devices
      • How to reduce backscatter and spam
      • How to check your website for broken links
      • How to troubleshoot network applications with curl
      • How to troubleshoot network applications with PowerShell and tnc
      • How to troubleshoot nameserver errors
      • Off-shore IP addresses
      • Google Chrome error message: "ERR_QUIC_PROTOCOL_ERROR"
      • How to set up a Wi-Fi hotspot on your mobile device
      • How to clear the DNS cache on macOS
      • How to change your DNS provider to reduce DNS propagation delays
    • Hostvento Hosting Policy FAQ
    • Why should I choose Hostvento Hosting?
    • What makes Hostvento Hosting’s service fast?
    • Solid State Drive (SSD) advantages
    • How To Start A Blog
    • How To Launch An eCommerce Website
    • How to determine your account's server name
    • Common web hosting terms and definitions
    • How to start a blog
      • How to start and run a blog
      • How to get started with WordPress
      • How to install and run a Nibbleblog site
      • Beyond WordPress basics
    • Top-level domain (TLD) availability
    • How to start a website on your hosting plan
    • How to determine which data center hosts your account
  • Folder icon closed Folder open iconEasy Website Software Setup Guide
  • Folder icon closed Folder open iconApplication optimization and configuration
    • How to enable the Redis extension for PHP
  • Folder icon closed Folder open iconSoftaculous 1-click application installer
    • When Will Softaculous Provide With The Latest Version Of A Script/Application?
    • How to use the Softaculous WordPress Manager
  • Folder icon closed Folder open iconHow to access the Hostvento Hosting Customer Portal
  • Folder icon closed Folder open iconHow to configure your domain to use Ezoic
  • Folder icon closed Folder open iconHow to back up and restore databases in Plesk
  • Folder icon closed Folder open iconHow to activate and configure Cloudflare ServerShield using the Plesk control panel
  • Folder icon closed Folder open iconHow to manage local backups on Dedicated servers
  • Folder icon closed Folder open iconHow to determine if your hosting account uses CloudLinux
  • Folder icon closed Folder open iconTurboHub: centralized, simplified WordPress site management from Hostvento Hosting

How to use Google Drive to back up and restore data

Estimated reading: 9 minutes 131 views

This article describes how to back up data on your Hostvento Hosting account to a Google Drive account, as well as how to restore data from Google Drive to your account. Using this configuration, your data is backed up securely to an off-site storage location.

  • If you have not already set up a Google Drive account, you must do so before following the procedures below. To set up a Google Drive account, please visit https://www.google.com/drive.
  • You can configure Google Drive backups on any Hostvento Hosting plan.
  • Google has changed the process for creating Google API credentials. As a result, the Google Drive configuration process now requires completing multiple procedures. Make sure you follow the procedures below in the order in which they appear.

Table of Contents

  • Step 1: Create Google API credentials
  • Step 2: Install the gdrive program on your local computer
  • Step 3: Add your Google account to gdrive
  • Step 4: Export the gdrive account configuration and upload it to the Hostvento Hosting server
  • Step 5: Install the gdrive program on your Hostvento Hosting account
  • Step 6: Back up data to Google Drive
  • Step 7 (optional): Restore data from Google Drive
  • More Information

Step 1: Create Google API credentials

First you must create a set of Google API credentials. At the end of this procedure, you will have a Client Id and Client Secret to use with the gdrive command-line program. The gdrive program enables you to access and manipulate Google Drive files and directories from the command line.

To create Google API credentials for your account, follow these steps:

  1. Log in to the Google Cloud Console with your Google Mail account at https://console.cloud.google.com/.
  2. Click the project list box, and then click NEW PROJECT:Google Cloud Console - Select projectGoogle Cloud Console - New project
  3. In the Project name list box, type a name for the project. In this procedure, we use the gdrive-example project name:
    Google Cloud Console - Project name
  4. Click CREATE.
  5. In the search bar, type drive api, and then under MARKETPLACE, click Google Drive API:
    Google Cloud Console - Google Drive API
  6. Click ENABLE:
    Google Cloud Console - Enable API
  7. Click the CREDENTIALS tab:
    Google Cloud Console - Credentials tab
  8. Click CONFIGURE CONSENT SCREEN:
    Google Cloud Console - Configure Consent Screen
  9. Under User Type, click External, and then click CREATE:
    Google Cloud Console - OAuth consent - External
  10. In the App name text box, type gdrive-example:
    Google Cloud Console - App name
  11. In the User support email list box, select your Google account.
  12. In the Developer contact information text box, type the email address for the developer.
  13. Click SAVE AND CONTINUE.
  14. Click ADD OR REMOVE SCOPES:
    Google Cloud Console - Add or Remove Scopes
  15. In the Filter text box, type google drive api, and then click Google Drive API:
    Google Cloud Console - Google Drive API filter
  16. Select the ../auth/drive check box and ../auth/drive.metadata.readonly check box:
    Google Cloud Console - Select scopes
  17. Click UPDATE, and then click SAVE AND CONTINUE:
    Google Cloud Console - Update scopesGoogle Cloud Console - Scopes - Save and continue
  18. Click ADD USERS:
    Google Cloud Console - Add Users
  19. In the text box, type the email address for your Google account, and then click ADD:
    Google Cloud Console - Email address - Add
  20. Click SAVE AND CONTINUE:
    Google Cloud Console - Users - Save and Continue
  21. In the left sidebar, click Credentials:
    Google Cloud Console - Sidebar - Credentials
  22. Click CREATE CREDENTIALS, and then click OAuth client ID:
    Google Cloud Console - Create Credentials - OAuth Client ID
  23. In the Application type list box, select Desktop app:
    Google Cloud Console - Application type
  24. In the Name text box, type gdrive cli.
  25. Click CREATE. The Client ID and Client secret appear. Click the clipboard icons to copy them, and then save them in a file. You will need these values later during the configuration process:
    Google Cloud Console - Client ID and Client Secret
  26. Click OK.
  27. In the left sidebar, click OAuth consent screen, and then click PUBLISH APP:
    Google Cloud Console - Publish app
  28. In the Push to production? dialog box, click CONFIRM:
    Google Cloud Console - Push to Production confirmation
  29. Under Publishing status should appear In production:
    Google Cloud Console - Publishing StatusYou can ignore the Needs verification warning in the Verification Status section. Gdrive functions normally without verification.

Step 2: Install the gdrive program on your local computer

After you create Google API credentials, you are ready to install the gdrive program on your local computer. The gdrive program enables you to access and manipulate Google Drive files and directories from the command line.

To add an account to gdrive, you must use a web browser during the initial setup process. However, the command-line environment on the server does not have a web browser. To work around this problem, you add the account to gdrive on your local computer, export the configuration, and then import that configuration into your Hostvento Hosting account on the web server. The following procedures demonstrate how to do this.

To install gdrive on your local computer, follow these steps:

  1. In your web browser, go to https://github.com/glotlabs/gdrive/releases.
  2. Download the correct file for your operating system:
    • Linux: gdrive_linux-x64.tar.gz
    • Apple macOS: gdrive_macos-x64.tar.gz
    • Microsoft Windows: gdrive_windows-x64.zip
    The most recent version when this article was published was 3.9.0.
  3. Decompress the compressed .tar.gz or .zip file to obtain the gdrive executable program.
  4. Open a command prompt (terminal) window in the directory where you extracted the downloaded file.
  5. To ensure gdrive works, type one of the following commands:
    • For Microsoft Windows:Copygdrive version
    • For Linux and macOS:
      Copy./gdrive version
    The version number should appear.

Step 3: Add your Google account to gdrive

After you install gdrive on your local computer, you are ready to add your Google account to the gdrive configuration. To do this, follow these steps:

  1. Open a command prompt (terminal) window.
  2. At the command prompt, type the following command:Copygdrive account add
  3. At the Client ID prompt, type (or copy and paste) the Client ID you obtained when creating Google API credentials.
  4. At the Client secret prompt, type (or copy and paste) the Client secret you obtained when creating Google API credentials.
  5. A URL appears. Open the URL in your web browser. You receive the Google hasn’t verified this app message:
    Google Drive - App verification warning
  6. Click Advanced, and then click Go to gdrive-example:
    Google Drive - Advanced - Go to gdrive-example
  7. Select the Select all check box, and then click Continue:
    Google Drive - Select accessGoogle adds your account.
  8. At the command prompt, type the following command:
    Copygdrive account listYour Google account email address should appear.

Step 4: Export the gdrive account configuration and upload it to the Hostvento Hosting server

Now that your Google account is configured in gdrive, you are ready to export the configuration and upload it to your hosting account on the Hostvento Hosting server. To do this, follow these steps:

  1. On your local computer, open a command prompt (terminal) window.
  2. At the command prompt, type the following command. Replace email-address with the email address of your Google account:Copygdrive account export email-address
  3. The previous step generates a .tar file. Using FTP or SCP, upload the .tar file to your Hostvento Hosting account on the remote server.

Step 5: Install the gdrive program on your Hostvento Hosting account

You are now ready to install the gdrive program on your hosting account and import the configuration you uploaded in the previous procedure. To do this, follow these steps:

  1. Log in to your Hostvento Hosting account using SSH.
  2. At the command prompt, type the following commands to download and extract the gdrive program:Copycd ~ wget https://github.com/glotlabs/gdrive/releases/download/3.9.0/gdrive_linux-x64.tar.gz tar xvzf gdrive_linux-x64.tar.gz
  3. To make the gdrive program accessible from any directory in your account, type the following commands:
    Copymkdir ~/bin mv ~/gdrive ~/bin
  4. To confirm gdrive is installed correctly, type the following command:
    Copygdrive versionYou should receive output that resembles the following text:gdrive 3.9.0 Commit: unknown Rust: 1.68.0 Arch: x86_64 OS: linux
  5. To import the account configuration, type the following command. Replace filename with the name of the .tar file you uploaded in the previous procedure:
    Copygdrive account import filenameThe Google account configuration process is now complete, and you are ready to configure backups for your Hostvento Hosting account.

Step 6: Back up data to Google Drive

After you install and configure the gdrive program, and have verified that gdrive can connect to Google Drive, you are ready to:

  • Create a directory on Google Drive to contain your backup files.
  • Create a cron job on your hosting account to do the actual backup.

To do this, follow these steps:

  1. To create a directory on Google Drive in which to store your backup files, type the following command. You can replace backups with any name you want to use:Copygdrive files mkdir backups
  2. To verify that the directory was created successfully, type the following command:
    Copygdrive files listNote the ID for the directory, as you will need this information below.
  3. After you verify that the Google Drive directory was created successfully, you are ready to set up a cron job that backs up files to the directory automatically. To do this, the cron command must run the gdrive program with the correct ID of the destination directory.

    For example, the following cron command demonstrates how to back up the entire public_html directory to the Google Drive backups directory daily at 2:30 AM. Replace username with your own Hostvento Hosting account username, and replace ID with the ID of the backups directory:
    30 2 * * * /home/username/bin/gdrive files upload –parent ID –recursive /home/username/public_htmlYou can also back up individual files. The following cron job shows how to do this with a file named backup.tar.gz:30 2 * * * /home/username/bin/gdrive files upload –parent ID /home/username/backup.tar.gzYou can set up the cron job using the crontab command line program, or by using cPanel (if your account includes cPanel access). For information about how to set up a cron job in cPanel, please see this article.

Step 7 (optional): Restore data from Google Drive

To restore data from Google Drive to your Hostvento Hosting account, follow this step:

  1. Use the gdrivefiles download commands:
    • To restore an individual file, type the following command. Replace ID with the ID of the file you want to restore:Copygdrive files download ID
    • To restore an entire directory, type the following command. Replace ID with the ID of the directory you want to restore:
      Copygdrive files download –recursive ID

More Information

  • For general information about Google Drive, please visit https://www.google.com/drive.
  • To view the official Google Drive documentation, please visit https://support.google.com/drive.

Still stuck? How can we help?

How can we help?

Was this page helpful? Yes No

Share this Doc

How to use Google Drive to back up and restore data

Or copy link

Clipboard Icon
CONTENTS
Leaf Illustration

© 2023 All Rights Reserved by Hostvento