Backing Up Google Drive to TrueNAS
3 minute read.Last Modified 2023-05-26 11:36 EDT
Google Drive and G Suite are widely used to create and share documents, spreadsheets, and presentations with team members.
Although 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.
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.
Google requests permission to access all the Google Drive files for the FreeNAS device.
Allow access. The appropriate access key generates in the FreeNAS access token. You may assign a Team ID if necessary.
Click VERIFY CREDENTIAL and wait for it to verify, then click SUBMIT
Go to Tasks > Cloud Sync Tasks and set the backup time frame, frequency, and folders (cloud-based folder and TrueNAS dataset). Set whether the synchronization should sync all changes, copy new files, or move files. 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 delete them from the source. With Move, users can set a folder in Google Drive for archival and move older documents to that folder from their Drive account. The task would automatically back up the files to the TrueNAS storage.
Once you create the task, attempt a Dry Run.
If the Dry Run succeeds, click SAVE..
Expand the section down to see the task options.
Clicking RUN NOW prompts the task to start immediately.
The web interface shows the status as RUNNING and SUCCESS upon completion. You can see details in the Task Manager. While the task runs, clicking on the RUNNING button reveals a popup log.
Once the sync reports SUCCESS, 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.
One caveat is that Google Docs and other files created with Google tools have their own proprietary set of permissions and their read/write characteristics unknown to the system over a standard file share. Files are unreadable as a result.
To allow Google-created files to become readable, allow link sharing to access the files before the backup. Doing so ensures that other users can open the files with read access, make changes, and then save them as another file if further edits are 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.
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 snapshots, copy-on-write, and built-in replication functionality.