OneDrive to Google Cloud Storage
Transfer files from Microsoft OneDrive to Google Cloud Storage.
People who wants to transfer files from Microsoft OneDrive to Google Cloud Storage
OneDrive gives free storage for a limited time, for example if you buy a new Samsung phone, OneDrive will give you additional 100GB free storage for 2 years. And Samsung Gallery backups your Camera photos to OneDrive. For 2 years, everything is awesome with that 100 GB free storage. But when the free storage expires, you are left with only 15 GB storage, Samsung Gallery and Microsoft bombards you with the alerts to upgrade your account.
You are left with 3 choices:
I wanted to transfer my files to Google Cloud Storage, because it is cheap and accessible for archival needs.
You should provide necessary data as environment variables. You can provide environment variables in a
Access token to be able to access OneDrive API. You can get it by following:
Access Token, click that tab, your access token will appear.
Simply copy that token and past it to
.env file as
Name of the Google Cloud Storage bucket. Make sure that there is a bucket of that name, if not, go to Google Cloud Console and create a bucket of that name.
Id of your OneDrive drive. You can get it by following:
Relative path of folder that has your files. For example if you want to transfer files which are located in
OneDrive->Personal Files->Photos->Exciting Day, then you should provide
ONE_DRIVE_FOLDER_RELATIVE_PATH=Personal Files/Photos/Exciting Day as environment variable.
If you run the script in a Compute Engine which is located in the same project with the bucket, you won’t need to authenticate. But if you are outside of the Google Cloud, you should visit https://cloud.google.com/docs/authentication/getting-started and follow the instructions to authenticate with Google Cloud.
npm run build
npm run start
#cloud #onedrive #web-development #developer