Giter Site home page Giter Site logo

google-drive-migrator's Introduction

Google Drive Migrator

Google Drive Migrator is a Python script that recursively copies the contents of a Google Drive folder into another folder on Google Drive using the Google Drive SDK.

Note: Before continuing you should consider whether Google Takeout meets your needs.

Prerequisites

The project uses Python 2.7 and pip.

  1. Grab the code git clone [email protected]:socialsquare/google-drive-migrator.git

  2. Install requirements pip install -r requirements.txt

  3. Get a Client ID and Secret Key

    1. Go to https://console.developers.google.com/

    2. Create a project

    3. Go to APIs & auth -> APIs and enable Drive API

    4. Go to APIs & auth -> Credentials and then Create new Client ID and create a Web application, with a callback URI http://localhost:8080/.

      You should now see a Client ID and a Secret Key.

      Notice that both Redirect URIs and JavaScript origins are set to http://localhost:8080/, if not, edit the setting and reset the secret.

    5. Click Download JSON and save the JSON file as client_secrets.json in the google-drive-migrator-folder.

Running

Run

python copy_folder.py GDRIVE_FOLDER_ID_FROM GDRIVE_FOLDER_ID_TO

, where GDRIVE_FOLDER_ID_FROM and GDRIVE_FOLDER_ID_TO are Google Drive folder ids of the folder to be copied from and the folder to be copied to respectively e.g.

python copy_folder.py 'AaaadadOIDSAD22323' 'BDK-LFJfkajsadJAd231j'

the Google Drive SDK will automatically open your webbrowser where you have to login to your Google account and authenticate the app you created. The authentication is saved in saved_credentials.json so that you don't have to login on subsequent uses.

When you have authenticated in the browser (it shows a boring page with the text "the request has been authorized"), the script will start copying the folder.

Best wishes! Malthe from Socialsquare

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.