- Head over to https://console.developers.google.com/ and sign in with your account.
- Click "Library" on the left column, then click on "Select a project" at the top. Click on
NEW PROJECTon the top-right corner of the new window. - In the Project name section, input any project name you chose. Keep a note of the Project ID for project that you make.
- Wait till the project creation is done and then click on "Select a project" again at the top and select your project.
- In the "Search for APIs & Services" search bar, look for "Google Drive API", click on it and press
ENABLE. Do the same for "Identity and Access Management (IAM) API". - Click on the Google APIs logo on the top-left, select your project, and then go to
IAM & admin -> Service accountsfrom the left pane. Next, press the blueCreate Service Accountbutton. In the Service account name section, input any name you want. Copy down the full Service account ID, you will need this later. After that, press CREATE. - Click on
Select a role. From theService Accountstab, selectService Account Adminrole. Then PressADD ANOTHER ROLE, and underService Accountstab, selectService Account Key Adminrole. and press CONTINUE. Then Press+ Create Key. Make sure the Key type is selected as JSON, and press CREATE. This should prompt you to save a JSON file. Save it in whereever the default download directory is for now. - Place the JSON file you saved alongside with the scripts.
- Go to Google Drive, sign in with your account. Go to Shared Drive tab and make a new Shared Drive. Add the email address you copied in Step 6 as a Manager in the Shared Drive. Copy the folder ID of the Shared Drive. It can be obtained from the URL when you open Shared Drive, it is 19 characters long and looks like 0xxxxxxxxxxxxxxxxx.
- Copy the folder ID of the folder you are trying to copy. It can be obtained from the folder URL, it is 33 characters long and looks like 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
- Open terminal in the scripts folder and run the following command.
python3 betterclone.py [projectid] [source] [destination] -k [JSON file]. Replace[projectid]with the Project ID saved in Step 3. Replace[source]with the ID copied in Step 11,[destination]with the ID copied in Step 10 and[JSON file]with the filename of the JSON saved in Step 7.