Tested on Windows only
This approach works on Windows. Not yet tested for Linux and Mac
Contents
1. Preparation
- Create a WebDAV Username and password for your Research Drive WebDAV connection. Follow the steps on the page on how to get your WebDAV credentials.
- Make sure that you save your WebDAV username and password somewhere safe before you press the “Done” button.
- Install Rclone: Make sure you install the newest version of Rclone for your operating system: https://rclone.org/downloads/
- Extract the zip file in Downloads
- Copy the rclone.exe file to a sensible location, like C:\Program Files\ rclone
- Open cmd.exe (press Win key + r). Type cmd.exe and select ok. Select the rclone.exe (Application) file and drag to the cmd.exe window, or run the following code in cmd.exe:
cd C:\Program Files\rclone
rclone.exe
Rclone will now be installed and a SharePoint and Research Drive WebDAV connection can be set up.
2. SharePoint connection with Rclone
A separate configuration option exists in Rclone to configure a OneDrive or SharePoint connection. Please follow the steps below to setup a SharePoint connection:
Open Windows Powershell and set up the configuration for SharePoint:
- Open Windows powershell (press win key and type “powershell”)
In Windows Powershell, run the following command:
rclone config
- Choose 'n' to create a new remote. Give your remote a name, for example “sharepoint”.
- Select the correct option:
- Choose the Microsoft OneDrive option (this may vary depending on the version, but for me it was option 33).
- Follow the steps for authentication:
- At the Option client_id question press enter (default value is used)
- At the question Option client_secret press enter (default value is used)
- At the Option region question select “Microsoft Cloud Global” (was option 1 for me)
- At the Edit advanced config question, select n for NO
- When asked: Use web browser to automatically authenticate, answer y for yes. Follow the instructions to sign in to your Microsoft account and grant Rclone the necessary permissions.
- Now select the Type of connection you want to use: Root Sharepoint site (option 2 for me) basically gives you access to the root of your Sharepoint.
- Now select the drive you want to use. The setup differs per institute, but I chose the default option 1 here. For me this was called “Documents”
- Answer y for yes to the question Drive ok?
- Answer y for yes to the question Keep this “sharepoint” remote?
- SharePoint is now configured as a new remote with Rclone. Press q for “Quit config" to exit the configuration.
- To test whether the remote is configured correctly, you can listen to the files in the root directory (note, this may take a while if there are many files/folders here):
rclone ls sharepoint:/Documenten
3. Connect ownCloud with Rclone
To configure a Research Drive connection with Rclone you can follow the steps from the page on how to configure Research Drive using Rclone.
NB: Choose a logical name for your new remote, like “rdrive”.
Check if your new remote is setup correctly:
rclone ls "rdrive:/Voorbeeld (Projectfolder)"
This should list all files and sub-directories in your requested directory.
If you now run the command: rclone listremotes
, both your newly configured "rdrive" connection and your "sharepoint" connection should appear:
Use "..." to encapsulate your path
Note: If your path contains spaces, like in Lilian (Projectfolder), you have to encapsulate the entire remote path using "..." signs.
4. Copy files or folders from SharePoint to Research Drive with Rclone
Both remotes have now been configuerd in Rclone and both can be approached in Windows powershell (or terminal voor Mac en Linux).
To copy a folder fromyour SharePoint remote to your Research Drive remote, you can run the following command in the Windows powershell:
rclone copy --use-cookies --timeout 50m "[naam sharepoint remote]:/pad/naar/source" "[naam research drive remote]:/pad/naar/destination"
For example:
rclone copy --use-cookies --timeout 50m "sharepoint:Documenten/source_folder" "rdrive:Voorbeeld (Projectfolder)/eind_folder"
Set --use-cookies and --timeout flags
The flag --use-cookies
is needed, to get you always on the same Research Drive back-end, to prevent file lock between back-ends
When you want to upload large files to Research Drive, we recommend using the --
flag of 10 minutes per gigabyte of the largest source file. timeout
As an example, the largest file in the source directory is 5GB. Calculating the argument for --timeout
gives: 10 minutes x 5GB = 50 minutes.
Use "..." to encapsulate your path
Note: If your path contains spaces, like in Lilian (Projectfolder), you have to encapsulate the entire remote path using "..." signs.