I have a QNAP NAS at home which I use for file storage. It shares several folders with the family’s Mac, Linux, and Windows computers. Many of these files are are irreplaceable, especially our digital photos, so I back them up to the cloud. QNAP provides the Hybrid Backup and Sync application, which supports multiple cloud storage endpoints. QNAP also provides specific documentation for backing up and syncing to Google Cloud Storage. However, QNAP’s instructions don’t explain how to set up a Google Cloud Storage bucket destination, so here is the procedure I used to set up Google Cloud Storage to back up my QNAP NAS.
Google Cloud Platform Configuration
- Create a Google Cloud Platform account
- Requires a payment method, such as a credit card
- The project name and ID will be auto-created. Auto-generated IDs work fine (see below if you are getting an error about an “Invalid Project Id”)
- Create a custom role for the QNAP backup service account
- Google Cloud Console->IAM & Admin->Roles
- Click “+ Create Role”
- Set meaningful values for Title, Description, and ID
- Click “+ Add Permissions”
- In the field with light gray text that says “Filter table,” type in
- Click the check box next each of the following permissions, and then click Add:
- Click the “CREATE” button
- Create a service account
- Download key in P12 format
- Grant custom role to service account
- In Google Cloud Console, go to IAM & Admin->IAM
- Click the “+ADD” button at the top
- Paste in the service account email address (or start typing for auto-complete)
- In the “Select a role” drop-down, use auto-complete to add the custom role you just created (see screenshot below)
- Click SAVE
- Create a Google Cloud Storage bucket
- Nearline storage
- Multi-region in US
- Choose “Set permissions uniformly at bucket-level (Bucket Policy Only)”
- Grant permissions to service account on bucket
- Edit bucket permissions
- Click “Add members”
- Paste in email address of service account
- Select role “Storage Object Admin”
EDIT 2019-08-19: Updated required permissions; see above.
If the QNAP Backup & Sync application gives you the error “Invalid project id” when connecting to Cloud Storage for the first time, it is not necessarily a problem with the project ID. There are a lot of misleading posts about this error on the QNAP Forums. Backup & Sync works fine with Google’s default project IDs. This error also happens when the service account you specified doesn’t have permission to list buckets. The procedure I outlined above prevents this problem by adding a custom role with the one required permission.
If you have a question or a suggestion to clarify the instructions, leave a comment and I will try to improve the instructions. Thanks!