(408) 943-4100               V   Commercial Support
Edit this page

How To Back Up Google Drive to TrueNAS CORE

  3 minute read.

Last Modified 2021-03-25 14:29 EDT

Google Drive and G Suite are widely used to create and share documents, spreadsheets, and presentations with team members. While cloud-based tools have inherent backups and replications included by the cloud provider, certain users may require additional backup or archive capabilities. For example, companies using G Suite for important work may need to keep records for years, potentially beyond the scope of the G Suite subscription. TrueNAS can easily back up Google Drive using its built-in cloud sync.

Setting up Google Drive credentials

Go to System > Cloud Credentials and click ADD. Name the Credential and select Google Drive as the Provider. Click LOGIN TO PROVIDER and log in with the appropriate Google user account.

CloudCredentialsAddCredentials

Google will request permission to access all the Google Drive files for the FreeNAS device.

GoogleOAuthProceed

GoogleOAuthAccount

GoogleOAuthPermissions

Allow access and the appropriate access key will generate in the FreeNAS access token. You may assign a Team ID if necessary.

Click VERIFY CREDENTIAL and wait for it to verify.

CredentialsVerify

Once successful, click SUBMIT. The new cloud credentials will be visible in the web interface.

CloudCredentials

Set the cloud sync task

Go to Tasks > Cloud Sync Tasks and set the backup time frame, frequency, and folders – both the cloud-based folder and TrueNAS dataset. Set whether the synchronization should sync all changes, copy new files, or move files. Files are removed from the cloud source or TrueNAS source depending on if the task is set to push or pull. Add a description for the task and select the cloud credentials. Choose the appropriate cloud folder target and TrueNAS storage location.

Select the file transfer mode:

  • Sync: Keep files newly created or deleted the same.
  • Copy: Copy new files to the appropriate target (i.e., TrueNAS pulls files from Google Drive or pushes files to Google Drive).
  • Move: Copy files to the target and then delete them from the source. Using Move, users can set a folder in Google Drive for archival, and move older documents to that folder from their Drive account. Those files would then automatically get backed up to their TrueNAS storage.

TasksCloudSyncCreate

Once you create the task, attempt a Dry Run.

CloudSyncDryRun

CloudSyncDryRunLog

If the Dry Run succeeds, click SAVE to save the task.

CloudSyncTaskNew

Expand the section down to see the options for the task.

CloudSyncTaskNewExpanded

Clicking RUN NOW will prompt the task to start immediately.

CloudSyncRunNow

CloudSyncTaskStarted

CloudSyncTaskRunning

The web interface will show the status as RUNNING and SUCCESS upon completion. Details can be accessed via the Task Manager icon in the upper right-hand corner. While the task is running, clicking on the RUNNING button will reveal a popup log.

CloudSyncTaskRunningLog

Once the sync reports a SUCCESS status, you can verify it by opening the folder on another computer if it is a share, through SSH access, or by checking the destination directory through the TrueNAS CLI.

CloudSyncTaskSuccess

Working with Google created content

One caveat is that Google Docs and other files created with Google tools will have their own proprietary set of permissions and their read/write characteristics will be unknown to the system over a standard file share. Files are unreadable as a result.

GoogleDriveBadPermissions

To allow Google created files to become readable, allow link sharing to access the files before the backup. Doing so will ensure that other users will be able to open the files with read access, make changes, and then save as another file should further edits be needed. Note that this is only necessary if the file was created using Google Docs, Google Sheets, or Google Slides; other files should not require modification of their share settings.

GoogleDriveShareLink

TrueNAS is perfect for storing content, including cloud-based content, for the long-term. Not only is it simple to sync and backup from the cloud, but users can rest assured that their data is safe, with unlimited snapshots, copy-on-write, and built-in replication functionality.