Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
This guide provides instructions for connecting to kDrive using the WebDAV connection protocol.
✘ UNAVAILABLE with
kSuite Free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
⚠ WARNING ⚠
Use the WebDAV protocol on kDrive for specific and occasional use cases:
- If you want to work on your files and share them, kDrive is the ideal tool.
- However, to secure your data against loss or corruption and ensure business continuity, Swiss Backup is the essential and appropriate solution.
Infomaniak guarantees the compliance of its services with standard protocols (IMAP, S3, etc.) but does not provide additional support for external services or software, as their configuration may change depending on the provider or publisher. This guide is therefore provided for informational purposes only, and its implementation remains your responsibility (ref.: Support Policy / Art. 11.9 of the Terms of Service). If needed, a qualified professional can assist you.
Obtain the ID (kDrive ID)
To find your kDrive ID:
- Click here to access the Infomaniak kDrive web app (online service ksuite.infomaniak.com/kdrive).
- The kDrive file structure is displayed in the left-hand menu.
- The URL
https://ksuite.infomaniak.com/34567/kdrive/app/drive/123456/files/56789orhttps://ksuite.infomaniak.com/all/kdrive/app/drive/123456/displayed at the top of your browser contains a number:
- In some cases, particularly when the Organization ID is mentioned in the URL, there may be several sets of numbers, but the principle remains the same: you need to take the number displayed after the term "/drive/":

This number (in the example 123456) is your kDrive ID (IDkDrive).
You will therefore need to enter https://IDkDrive.connect.kdrive.infomaniak.com whenever necessary (e.g., https://123456.connect.kdrive.infomaniak.com as the WebDAV address).
Specific WebDAV Guides
Examples of synchronization via WebDAV:
WebDAV connection URL directly to a specific folder
To facilitate a direct connection via WebDAV to a specific folder, you can use the following URL (replacing 123456 as above):
https://12345.connect.kdrive.infomaniak.com/Common documents/folder-nameThis simple method allows you to quickly access the desired folder without manually navigating through the directory structure. Simply replace "folder-name" with the exact name of the target folder to establish a direct and secure connection via WebDAV.
Link to this FAQ: https://faq.infomaniak.com/2409
Has this FAQ been helpful?
This guide explains how to synchronize your Obsidian vault on your Infomaniak kDrive via the WebDAV protocol. This way, you can keep your notes safe in a storage medium located in Switzerland.
✘ UNAVAILABLE with
kSuite free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
Introduction
- Obsidian is a powerful and extensible note-taking tool that uses local Markdown files to organize your knowledge.
- To avoid cluttering your kDrive directories, it is strongly recommended to create a dedicated folder in your personal directory on kDrive, with a simple folder name such as "
obsidian" for example, and then specify it at the end of the WebDAV link in step 7 below:
Configure Obsidian to use kDrive via WebDAV
Prerequisites
The integration relies on the community plugin WebDAV Sync, which ensures two-way synchronization:
- Open your vault in the Obsidian application.
- Go to Settings.
- Go to Community plugins.
- Enable them:

- Click on Browse:

- Search for the WebDAV Sync plugin, install it, and enable it:

- Access the plugin's options to enter the WebDAV account settings:

- Server address:
https://IDkDrive.connect.kdrive.infomaniak.com(see prerequisites) - Username: email address used to log in to your Infomaniak account
- Password: application password if two-factor authentication is enabled or your Infomaniak user account password if you have not enabled 2FA
- Name of the personal folder on kDrive, for example
/obsidian/or /folder name/ (see the introduction above)
- Server address:
- Configure the plugin's behavior according to your preferences (synchronization on startup, scheduled, or in real time) and validate.
- Start a first synchronization test to validate proper communication with kDrive:

- Once the confirmation is validated, the synchronization will run in the background to protect the integrity of your notes:

Link to this FAQ: https://faq.infomaniak.com/2910
Has this FAQ been helpful?
This guide explains how to store Joplin's database on your Infomaniak kDrive and connect your various devices to it via the WebDAV protocol. This way, you can keep your notes safe in a storage medium located in Switzerland.
✘ UNAVAILABLE with
kSuite free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
Introduction
- Joplin is a free and open-source note-taking tool that allows you to organize all your notes into folders and access them from any device (computer, mobile device, etc.).
- Joplin will store several of its configuration files, so to avoid cluttering your kDrive directories, it is recommended to create a dedicated folder in your personal directory on kDrive, with a simple folder name such as "
joplin" for example, and then specify it at the end of the WebDAV link in step 6 below:
Configure Joplin to use kDrive via WebDAV
Prerequisites
The example below is very similar for all versions of Joplin:
- Open the Joplin application.
- Go to the application's settings:

- Tap Sync.
- Tap the menu to select a target.
- Choose the WebDAV mode:

- For the account settings, use the following information:

- Server address:
https://IDkDrive.connect.kdrive.infomaniak.com(see prerequisites) followed by/joplinor /folder name (see the introduction above) - Username: email address used to log in to your Infomaniak account
- Password: application password if two-factor authentication is enabled or your Infomaniak user account password if you have not enabled 2FA
- Server address:
- Tap test synchronization below and wait for the connection confirmation.
- Check in your kDrive folder that the Joplin files are being written correctly:

- Go back to the notes to start working.
Link to this FAQ: https://faq.infomaniak.com/1800
Has this FAQ been helpful?
This guide provides instructions to synchronize kDrive with Linux using the WebDAV connection protocol.
✘ UNAVAILABLE with
kSuite Free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
Preamble
- Most recent software supporting the WebDAV protocol are compatible with kDrive offers among those also supporting WebDAV. Infomaniak cannot guarantee the compatibility of the service with external applications and does not provide support for this protocol.
- It is recommended to install the kDrive application to avoid any file loss.
Connect to kDrive via WebDAV on Linux (Gnome)
To do this:
- Open Files.
- In the sidebar, click on Network:

- Enter the server address:
davs://IDkDrive.connect.kdrive.infomaniak.com(need help?). - Click on Connect.
- For account settings, use the following information:
- Username: email address to log in to your Infomaniak account
- Password: create an application password for this specific use.
- Click on Login.
Link to this FAQ: https://faq.infomaniak.com/2894
Has this FAQ been helpful?
This guide provides instructions to synchronize kDrive with a Qnap NAS (or vice versa) via the WebDAV protocol found in the HBS 3 Hybrid Backup Sync application.
✘ UNAVAILABLE with
kSuite Free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
Prerequisites
- Have a Qnap NAS accessible from the Internet.
- Know your kDrive identifier (kDrive ID).
Synchronize kDrive and Qnap via HBS 3
To do this:
- Log in to the Qnap NAS administration interface (QTS).
- If necessary, download and install the app HBS 3 Hybrid Backup Sync.
- Open HBS 3.
- Go to Sync from the left menu.
- Create a synchronization task (Two-way Sync Job).
- Select WebDAV from the list of Cloud providers:

- For the account parameters, use the following information:
- Server address:
https://IDkDrive.connect.kdrive.infomaniak.com(see prerequisites above) - Username: email address to log in to the Infomaniak account
- Password: create an application password for this specific use.
- Server address:
- Select the local and destination folders:

- Customize the task frequency.
- Complete the wizard.
Link to this FAQ: https://faq.infomaniak.com/2405
Has this FAQ been helpful?
This guide provides instructions to synchronize kDrive with a Synology NAS (or vice versa) via the WebDAV protocol found in the Cloud Sync application.
✘ UNAVAILABLE with
kSuite Free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
Prerequisites
- Have a Synology NAS accessible from the Internet.
- Know your kDrive identifier (kDrive ID).
Synchronize kDrive and Synology via Cloud Sync
To do this:
- Log in to the Synology DiskStation Manager (DSM).
- If necessary, download and install the Cloud Sync app from the Package Center.
- Open Cloud Sync.
- Click on the + at the bottom left to add a Cloud.
- Select WebDAV at the bottom of the list of available Clouds:

- For the account parameters, use the following information:
- Server address:
https://IDkDrive.connect.kdrive.infomaniak.com(see prerequisites above) - Username: email address to log in to your Infomaniak account
- Password: create an application password for this specific use.
- Server address:
- Choose the local folder, destination, and desired synchronization type:

- Bidirectional: changes made will be reflected in both directions.
- Download only remote changes: ideal for backing up a kDrive to your NAS.
- Download only local changes: ideal for backing up data from your NAS to a kDrive.
Link to this FAQ: https://faq.infomaniak.com/2404
Has this FAQ been helpful?
This guide provides instructions for synchronizing kDrive with a VPS (or vice versa) via the WebDAV protocol found in the rClone application.
✘ UNAVAILABLE with
kSuite Free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
Prerequisites
- Have a VPS.
- Know your kDrive identifier (kDrive ID).
Synchronize kDrive and VPS via rClone
This operation allows you to retrieve in real-time the files and folders from kDrive and to read, create, or modify these files from your VPS while ensuring they are synchronized back to the kDrive server. An rClone mount point can be created with a folder on your VPS to manipulate these kDrive files.
Refer to the rClone documentation if you are looking for information about the available options:
- Example of rClone command:
rclone mount kdrive:/My_kDrive_Folder_Path /home/ubuntu/Target_Folder_Path --vfs-cache-mode full --vfs-cache-max-age 24h --vfs-cache-max-size 10G --cache-dir /home/ubuntu/rclone/cache --daemon --allow-other --dir-cache-time 1h --log-file /home/ubuntu/rclone/rclone.log --log-level INFO- The
--daemonattribute of this command allows you to run the synchronization as a background task because without it, this sync stops at each VPS disconnection…
- Example of rClone configuration file:
[kdrive] type = webdav url = https://xx.connect.kdrive.infomaniak.com/xx vendor = other user = *** pass = ***- Server address:
https://IDkDrive.connect.kdrive.infomaniak.com(see prerequisites above) - Username: email address to log in to your Infomaniak account
- Password: create an application password for this specific use.
Link to this FAQ: https://faq.infomaniak.com/2636
Has this FAQ been helpful?
This guide explains how to import (one single time) to kDrive data (files, folders, etc.) from an external Cloud, such as your previous provider's, for example Dropbox or Microsoft.
Prerequisites
- Have a kDrive or my kSuite offer
- Have sufficient permissions within kDrive or my kSuite.
- Do not change your passwords until the import is complete!
Specific guides
Click on the link corresponding to your current host:
- Google Photos: complete guide to migrate photos from Google Photos to Infomaniak
- Google Drive
- Apple iCloud
- Any other Cloud provider offering the WebDAV protocol: refer to this other guide
Guide for any other external Cloud provider
For example:
- Dropbox
- OneDrive
- OwnCloud
- NextCloud
- Another kDrive to which your user account has access (except for "external" type access)
Data not imported
- Data that has been shared with you is not imported.
- Only data that truly belongs to you will be imported.
- Google documents such as Gdocs, Sheets, Slides, etc. …
- … are not imported during a Dropbox import.
- … are converted by Google when these files are downloaded from Google Drive on macOS/Windows.
- … are not converted when they are copied from the local Google Drive directory to the local kDrive directory. Therefore, it is imperative to download the files from the Web version of Google Drive.
- Dropbox Paper documents.
- Dropbox share links visible here.
- Individually shared Dropbox files, visible here (however, shared folders and common documents will be imported).
To proceed with the data import:
- Click here to access the Infomaniak kDrive Web app (online service ksuite.infomaniak.com/kdrive).
- Click on the Settings icon in the top right corner.
- Check or select the relevant kDrive in the dropdown menu of the left sidebar.
- Click on Import external data under General:

- Click on Start or New import at the top:

- Choose the relevant service.
- Choose the location where the imported files will be stored.
- Enter any required information if prompted and click the blue Start button:

- Enter any required information if prompted and click the blue Continue button.
- Complete the wizard.
- Wait while the data is being imported.
Manage the ongoing import
To monitor ongoing imports, return at any time to the page mentioned in point 5 above.
To stop an ongoing import, click on the action menu to the right of the import listed on the page and choose to cancel (in case of voluntary interruption, a report is sent by email to the administrator).
A second consecutive import would re-import all the data (to another kDrive directory), it is not differential synchronization and there is no duplicate management.
Check your imported data immediately after the operation.
Link to this FAQ: https://faq.infomaniak.com/2406
Has this FAQ been helpful?
This guide explains how to import external data (files, folders, etc.) to your kDrive using the WebDAV protocol provided by your Cloud host.
Preamble
- Refer to this other guide if you are looking for information on how to copy specific data from one kDrive to another when your user has access to both kDrives concerned.
Import external data via WebDAV
Prerequisites
- Have a kDrive or kSuite offer
- Have sufficient permissions within kDrive or kSuite.
- Do not change your passwords until the import is complete!
To access the import tool, where the data needs to be imported:
- Click here to access the Infomaniak kDrive Web app (online service ksuite.infomaniak.com/kdrive).
- Click on the Settings icon in the top right corner.
- Check or select the kDrive concerned in the dropdown menu of the left sidebar.
- Click on General in the left sidebar.
- Click on Import external data:

- Click the blue Start button:

- Click on WebDAV.
- Complete the requested information based on the source (including the WebDAV address you have - obtained from the source).
- Choose the destination kDrive and the desired location to host the imported data.
- Click on Start:

Link to this FAQ: https://faq.infomaniak.com/2557
Has this FAQ been helpful?
This guide details how to import data from Google Drive using rClone to kDrive Infomaniak.
✘ UNAVAILABLE with
kSuite free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
⚠ WARNING ⚠
Infomaniak guarantees that its services comply with standard protocols (IMAP, S3, etc.) but does not provide additional support for external services or software, as their configuration may change depending on the provider or publisher. This guide is therefore provided for informational purposes only, and its implementation remains your responsibility (ref.: Support Policy / Art. 11.9 of the Terms of Service). If needed, a qualified professional can assist you.
1. Configure rclone for drive access
Install rclone on your computer
There is a version of rclone with a graphical interface (GUI) but it is perfectly possible to do this via the command line (CLI):
- Install rclone from a
Terminalapplication on your device by typing the following command:sudo -v ; curl https://rclone.org/install.sh | sudo bash - Enter the password for your session on your computer to begin the installation:

- Refer to the official installation guide if needed.
Configuring the remote disk (Google Drive) in rclone
- Once rclone is installed, enter the command
rclone config.- Refer to the official configuration guide if needed.
- Then, choose to configure a new remote import by answering
nforNew remote. - Name the remote disk, for example
gdrive:
- Then, choose the type of disk to import by answering
drive, which corresponds to Google Drive among the choices offered.
You will then need to authorize the connection to Google Drive from a browser.
By default, rclone uses a client ID shared among all users, which may result in request limitations imposed by Google. It is strongly recommended to use your own client ID to avoid these restrictions.
- Go to the Google API Console with your Google account.
- Create or select a project.
- Enable the Google Drive API via the "Enable APIs and Services" button/link.
- Search for the keyword
Driveand click onGoogle Drive API:
- Click on the Enable button.
- Click on Credentials in the left-hand menu (and not on a similar button).
- Click on Configure the OAuth consent screen (if this has not already been done):
- Enter a name, for example
rclone. - Select "External" (or "Internal" if you are a Google Workspace user).
- Under “Data access”, add the necessary scopes:
https://www.googleapis.com/auth/docs,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/drive.metadata.readonly
- Save.
- Add your email account as a test user under "Audience".
- Go back to the "Google Auth Platform" section.
- Enter a name, for example
- Create OAuth credentials:
- Click on "Create credentials / OAuth client ID".
- Choose "Desktop app" and leave the default name, then click the Create button.
- Keep the displayed
client IDandclient secret code.
- If "External" was chosen in step 7 above, go back to “Audience” in the left-hand menu and click on “Publish app”.
Due to the “enhanced security” recently introduced by Google, you are theoretically supposed to “submit your application for verification” and wait several weeks for their response.
In practice, you can directly use the client ID and client secret with rclone (see the rest of the guide). The only consequence will be a very intimidating confirmation screen when you connect via your browser to allow rclone to obtain its token ID. However, since this only happens during the initial configuration of the remote storage, it is not a major problem.
It is also possible to leave the application in “Test” mode, but in this case, any authorization will expire after a week, which may be inconvenient to renew frequently. If a short validity period does not pose a problem for your use, then keeping the application in test mode may be sufficient.
Return to rclone in the terminal:
- Tell rclone the
client_idby copying and pasting theClient IDobtained in step 8 above, and do the same for the secret phrase. - Then choose
scopenumber 1:
- Press the “
Enter” key to leave theservice_account_filequestion blank. - Answer “No”
nto the question about “advanced configuration”. - Answer “Yes”
yto the question about connecting via a web browser:
- A web page will open in your web browser, allowing you to connect to Google and authorize the application you created in step 9 above.
- Once the permissions have been granted, you should receive the following message:

- In the terminal, answer “No”
nto the question about “Shared Drive (Team Drive)”. - Answer “Yes”
yto the last question:
Configuring the destination drive (kDrive) in rclone
It is possible to directly modify the rclone configuration file by pasting your kDrive configuration into it, for example:
[kdrive]
type = webdav
url = https://kDrive_ID_HERE.connect.kdrive.infomaniak.com/
vendor = other
user = user@email.com
pass = PASSWORD_HERE_OR_APP_PASSWORD_IF_2FABut here is how to proceed step by step, as with the previous configuration:
- Still in the terminal, enter
nfor a new drive configuration and enter the namekDriveto recognize your destination drive:
- Then, choose the type of drive to import by answering
webdav, which corresponds to a WebDAV configuration among the choices offered. - Enter the following information:
url= the direct access to kDrive (refer to this other guide regarding the kDrive ID for the connection URL)vendor= rclone (option no. 6)user= the email address used to log in to your Infomaniak user account
- Answer “Yes”
yto the password question and then enter the password:- application password if two-factor authentication is enabled, or the password for your Infomaniak user account if you have not enabled 2FA.
- Leave the
bearer_tokenfield blank and then answer “No”nto the “advanced configuration” question. - Answer “Yes”
yto the last question, and your two disks will be displayed:
2. Copy data from Google Drive to kDrive
kDrive supports rclone's streaming upload via WebDAV with automatic error handling if the limit is exceeded without prior specification of the size via Content-Length.
Prerequisites
- Consult the available options in the official guide before starting an import, especially these important commands:
--drive-skip-shortcutsto avoid infinite import loops--drive-shared-with-meto obtain what has been shared--drive-acknowledge-abuseto force the download of files blocked by Google
Example command to start copying your Google Drive to the root of your kDrive:
sudo rclone copy gdrive: kDrive:This will start copying your folders, subfolders, and Google Drive content to the personal folder of your Infomaniak kDrive!
Google Docs files, such as Gdocs, Sheets, and Slides, are converted to Office formats like .docx and .xlsx, and can be read directly in kDrive.
Link to this FAQ: https://faq.infomaniak.com/2408
Has this FAQ been helpful?
This guide explains how to import data from iCloud Drive or iCloud Photos to kDrive Infomaniak using rclone.
✘ UNAVAILABLE with
kSuite free / kSuite Standard
my kSuite / my kSuite+ (ik.me, etik.com, ikmail.com)
Introduction
- This method is intended for advanced users who want to transfer data from iCloud to kDrive without manually copying files one by one.
- rclone allows you to configure an iCloud Drive or iCloud Photos source, and then a kDrive destination via WebDAV.
- Accessing iCloud with rclone requires the usual Apple ID password and two-factor Apple authentication. Apple application passwords are not accepted for this configuration.
- iCloud authentication may need to be renewed periodically with
rclone reconnectorrclone config. - The
rclone copycommand copies files to kDrive without deleting them from the source iCloud.
1. Install rclone
rclone can be installed via the command line. On macOS, Linux, or BSD, open the Terminal application and run the following command:
sudo -v ; curl https://rclone.org/install.sh | sudo bashRefer to the official rclone installation guide if necessary, especially for Windows or for a manual installation.
Once the installation is complete, verify that rclone responds correctly:
rclone version
2. Configure the iCloud source in rclone
In Terminal, start the rclone configuration:
rclone config- Choose
nto create a new remote drive. Give this source an explicit name, for example:
iCloudDrive- Choose the storage type
iclouddrive. - To import documents stored in iCloud Drive, keep the default service
drive. - To import items from iCloud Photos, choose the
photosservice or create a second dedicated remote drive, for exampleiCloudPhotos. - Enter your Apple ID, which is usually an email address.
- Choose to enter your own password, then enter your usual Apple ID password.
- Answer
nto advanced configuration, unless you have a specific need. - Validate the connection from your trusted Apple device, then enter the two-factor authentication code when rclone asks for it.
- When the summary is correct, answer
yto save the configuration.
Verify that the iCloud source is accessible:
rclone lsd iCloudDrive:If you have configured a source dedicated to iCloud Photos, verify it as well:
rclone lsd iCloudPhotos:
3. Configure the kDrive destination in rclone
kDrive must be configured in rclone as a WebDAV storage.
Rerun the configuration if you are no longer in the rclone menu:
rclone config- Choose
nto create a new remote drive. Give the destination an explicit name, for example:
kDrive- Choose the storage type
webdav. - For the URL, enter the direct WebDAV access to your kDrive:
https://ID_KDRIVE.connect.kdrive.infomaniak.com/- Replace
ID_KDRIVEwith your kDrive ID; refer to this other guide if needed.
- For the WebDAV provider (
vendor), chooseother. - For the user (
user), enter the email address used to log in to your Infomaniak user account. - For the password, enter:
- an application password if two-factor authentication is enabled on your Infomaniak account;
- the password for your Infomaniak user account if two-factor authentication is not enabled.
- Leave the
bearer_tokenfield blank.
- Answer
nto the advanced configuration prompt, unless you have a specific need.
[kDrive]
type = webdav
url = https://ID_KDRIVE.connect.kdrive.infomaniak.com/
vendor = other
user = user@example.com
pass = PASSWORD_STORED_BY_RCLONE- When the summary is correct, answer
yto save the configuration.
The resulting configuration will look like this in the rclone configuration file:
rclone lsd kDrive:
The password displayed in the rclone configuration file is not stored in plain text when the configuration is created using rclone config. If you modify this file manually, generate the value for the pass field using the rclone obscure command.
Verify that the kDrive destination is accessible:
4. Copy data from iCloud to kDrive
rclone lsd iCloudDrive:It is recommended to perform a test without the actual transfer using --dry-run:
rclone copy iCloudDrive: kDrive:iCloudDrive --dry-run --progressIf the result is correct, start the copy:
rclone copy iCloudDrive: kDrive:iCloudDrive --progress --transfers 4 --checkers 8 --retries 5 --low-level-retries 10 --log-level INFO --log-file "$HOME/Desktop/rclone-kdrive-import.log"This command copies the folders, subfolders, and files from the source iCloudDrive: to the iCloudDrive folder in your kDrive.
In case of a connection or computer interruption, rerun the same command. rclone will resume the comparison and avoid copying files that are already present when their size and available information match.
To verify the consistency of the copied volume, you can compare the source and destination by size:
rclone check iCloudDrive: kDrive:iCloudDrive --size-only --one-way --progress
Copying iCloud Photos
If you have configured a source dedicated to iCloud Photos, first list the available libraries and folders:
rclone lsd iCloudPhotos:Then, adapt the source path according to the tree structure displayed by rclone. Example:
rclone copy iCloudPhotos: kDrive:iCloudPhotos --dry-run --progressThen, start the copy if the test result is correct:
rclone copy iCloudPhotos: kDrive:iCloudPhotos --progress --transfers 4 --checkers 8 --retries 5 --low-level-retries 10 --log-level INFO --log-file "$HOME/Desktop/rclone-kdrive-photos.log"
5. Correct photo dates if necessary
After exporting or copying photos, the system dates of the files may no longer match the original date the photo was taken. If the chronological display is not correct, you can correct the dates on a local copy of the files before sending them permanently to kDrive.
Always work on a local copy of the files before running a correction script. The script below does not run directly on a remote rclone source; it processes a folder present on the computer.
To prepare a local folder for correction, copy the photos to a temporary folder on the desktop, for example:
rclone copy iCloudPhotos: "$HOME/Desktop/iCloud-Photos" --progressThen, install ExifTool from https://exiftool.org/index.html, and then run the script below on macOS from the Terminal application.
The script searches for a date in the file's metadata, then in its name. The corrected files are listed in DateFound.txt and the files without a usable date are listed in DateError.txt, on the desktop.
The script to copy and paste entirely:
/bin/bash <<'BASH'
#!/bin/bash
set -u
ROOT="$(osascript -e 'POSIX path of (choose folder with prompt "Select the folder containing the files to update")')" || exit 0
DESKTOP="$HOME/Desktop"
LOG_FOUND="$DESKTOP/DateFound.txt"
LOG_ERROR="$DESKTOP/DateError.txt"
: > "$LOG_FOUND"
: > "$LOG_ERROR"
find_exiftool() {
if command -v exiftool >/dev/null 2>&1; then
command -v exiftool
return 0
fi
if [ -x "/usr/local/bin/exiftool" ]; then
printf '%s\n' "/usr/local/bin/exiftool"
return 0
fi
if [ -x "/opt/homebrew/bin/exiftool" ]; then
printf '%s\n' "/opt/homebrew/bin/exiftool"
return 0
fi
return 1
}
EXIFTOOL="$(find_exiftool)" || {
printf '%s\n' "ExifTool not found. Install it, then run the script again." >> "$LOG_ERROR"
printf '%s\n' "ExifTool not found. Check DateError.txt on the desktop."
exit 1
}
if [ ! -d "$ROOT" ]; then
printf 'Invalid folder: %s\n' "$ROOT" >> "$LOG_ERROR"
printf '%s\n' "Invalid folder. Check DateError.txt on the desktop."
exit 1
fi
get_exif_date() {
"$EXIFTOOL" -s3 -d "%Y:%m:%d %H:%M:%S" -DateTimeOriginal -CreateDate -MediaCreateDate -TrackCreateDate -CreationDate -ModifyDate -- "$1" 2>/dev/null | awk '/^[0-9]{4}:[0-9]{2}:[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/ { print substr($0, 1, 19); exit }'
}
get_name_date() {
local name
name="$(basename "$1")"
if [[ "$name" =~ ([12][0-9]{3})[-_]?([01][0-9])[-_]?([0-3][0-9])([_\ -]?([0-2][0-9])[-_\.]?([0-5][0-9])[-_\.]?([0-5][0-9]))? ]]; then
local year="${BASH_REMATCH[1]}"
local month="${BASH_REMATCH[2]}"
local day="${BASH_REMATCH[3]}"
local hour="12"
local minute="00"
local second="00"
if [ -n "${BASH_REMATCH[5]:-}" ]; then
hour="${BASH_REMATCH[5]}"
minute="${BASH_REMATCH[6]}"
second="${BASH_REMATCH[7]}"
fi
printf '%s:%s:%s %s:%s:%s\n' "$year" "$month" "$day" "$hour" "$minute" "$second"
return 0
fi
return 1
}
is_valid_date() {
date -j -f "%Y:%m:%d %H:%M:%S" "$1" "+%Y:%m:%d %H:%M:%S" >/dev/null 2>&1
}
to_touch_date() {
printf '%s' "$1" | sed -E 's/^([0-9]{4}):([0-9]{2}):([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/\1\2\3\4\5.\6/'
}
write_metadata() {
local file="$1"
local date_value="$2"
"$EXIFTOOL" -overwrite_original "-DateTimeOriginal=$date_value" "-CreateDate=$date_value" "-ModifyDate=$date_value" -- "$file" >/dev/null 2>&1 || true
}
process_file() {
local file="$1"
local date_value=""
local source=""
date_value="$(get_exif_date "$file")"
if [ -n "$date_value" ]; then
source="EXIF"
else
date_value="$(get_name_date "$file")"
if [ -n "$date_value" ]; then
source="file name"
fi
fi
if [ -n "$date_value" ] && is_valid_date "$date_value"; then
local touch_value
touch_value="$(to_touch_date "$date_value")"
if [ "$source" != "EXIF" ]; then
write_metadata "$file" "$date_value"
fi
if touch -t "$touch_value" "$file" 2>/dev/null; then
printf '%s | %s | %s\n' "$source" "$date_value" "$file" >> "$LOG_FOUND"
else
printf 'Unable to update file date: %s\n' "$file" >> "$LOG_ERROR"
fi
else
printf 'No valid date found: %s\n' "$file" >> "$LOG_ERROR"
fi
}
while IFS= read -r -d '' file; do
case "$file" in
*.json|*_original) continue ;;
esac
process_file "$file"
done < <(find "$ROOT" -type f -print0)
printf '%s\n' "Done. Check DateFound.txt and DateError.txt on the desktop."
BASHAfter correction, send the corrected local folder to kDrive:
rclone copy "$HOME/Desktop/iCloud-Photos" kDrive:iCloudPhotos --progress --transfers 4 --checkers 8 --retries 5 --low-level-retries 10
6. Accessing data from kDrive
Once the copy is complete, your data is accessible from the kDrive web app, the kDrive mobile apps, and devices synchronized with the kDrive desktop app.
If you are also using the kDrive desktop app, wait until the local synchronization is complete before moving or renaming the imported folders.
Link to this FAQ: https://faq.infomaniak.com/2515
Has this FAQ been helpful?

