How to archive NetSuite’s File Cabinet to Google Drive
If you want to archive and back up the files in your NetSuite File Cabinet to Google Drive, you can easily achieve this with a custom-built archiving application. In this article, I’ll outline the steps that you can take to build your own application written in your preferred programming language. If you’d rather skip the technical work, feel free to contact me – I’ve built a ready-to-deploy solution that many clients already use successfully.
The application can perform an initial sync to copy all the files from NetSuite to Google Drive. Then it can detect when new files are added to the File Cabinet and upload those new files to Google Drive.
Here’s a high-level overview of how you can build such a solution.
Step 1: Create a Google service account
A service account is a special kind of Google account used by an app, rather than a person, to authenticate and access Google APIs. You need a service account to be able to connect to and send files to Google Drive via the Google API.
You need to follow these instructions to create the Google service account: How to create a Google service account
At the end of that process you will download a JSON file containing the auth credentials. Your application will need to use this to connect to the Google Drive API.
The service account will have its own Google Drive folder. When it uploads the File Cabinet files those files will not be visible to anyone. In your app, you will need code that will share the files with all your users. After that, these users will be able to see the files under ‘Shared with me’.
Step 2: Enable the Google Drive API
You will need to enable the Google Drive API so that you can upload files to Google Drive using the application. Instructions for enabling the Google Drive API are here: How to enable the Google Drive API.
Step 3: Set up Token Based Authentication (TBA) in NetSuite
You will need to set up Token Based Authentication (TBA) in NetSuite so that your application can connect to NetSuite and extract data and files from the File Cabinet. You can find tnstructions for setting up TBA for NetSuite here: How to set up token-based authentication for NetSuite’s SuiteTalk REST API
Step 4: Code the application to do the backup
Now you have everything you need to be to code your application.
If you are using node.js, here is some Javascript code that shows you how to connect to NetSuite using TBA:
How to connect to NetSuite’s SuiteTalk REST API using node.js
If you are using Python, here is some Python code that does the same:
How to connect to NetSuite’s SuiteTalk REST API using Python
Of course, you can use any other programming language.
You need to connect to the NetSuite REST API or SOAP API to get the details of all the files in the File Cabinet. After that you can download the files. This can presently only be done using SOAP not REST. Then you need to upload the files to Google Drive using the Google Drive API. To make the process more efficient you need to monitor file modified dates so that you don’t re-upload the same files over and over again. Rather, only new files or recently modified files should be uploaded.
Conclusion
I’ve outlined an approach that you can take to back up your files from your NetSuite File Cabinet to Google Drive.
If you don’t want to build your own application, I can offer a working solution that is used by several clients. My application connects to NetSuite to do an initial sync to copy everything to Google Drive. Then it runs periodically to check if new files have been added to the File Cabinet or existing files have been updated. If that has happened, it then uploads those new and updated files to Google Drive. All of this can run on your own servers so that you have complete security and full control over the process.
If you are interested in this solution, please reach out to info@mubasoftware.com .