I tried to backup my files to encrypted onedrive with default filename encrypt/encoding, but lots of file failed due to 'pathTooLong'
so I try to use rclone to migrate existing backup into other filename encoding (or disable filename/dir encrypt)
then I found rclone docs
server_side_across_configs
This can be used, for example, to change file name encryption type without re-uploading all the data. Just make two crypt backends pointing to two different directories with the single changed parameter and use rclone move to move the files between the crypt remotes.
so now I have 3 config:
bare onedrive config, all default config, no advanced options edited
encrypt config1, all default config (with my own password1/password2), no advanced options edited (I've already upload lots of data into this config, but some path too long file failed)
encrypt config2, all default config (with same password1/password2 to config1), change dir crypt to false
(I want to use rclone server copy ability to copy files from config1 into this config2, with dir crypt disabled, so all of my backup migrate to new config without re-uploading, then I can continue to upload failed ones into this config)
firstly, I tried two config with exactly same config (both has dir encryption turned on), even with this exactly same config, rclone still not using server side copy. this is log for such run
D:\asj\rclone>rclone copy config1:/git-log.txt config2:/ -vv
2023/01/05 08:49:37 DEBUG : Setting default for crypt-server-side-across-configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:49:37 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "copy" "config1:/git-log.txt" "config2:/" "-vv"]
2023/01/05 08:49:37 DEBUG : Creating backend with remote "config1:/git-log.txt"
2023/01/05 08:49:37 DEBUG : Using config file from "C:\\Users\\comicfans.DESKTOP-35AEQ6R\\.config\\rclone\\rclone.conf"
2023/01/05 08:49:37 DEBUG : Setting crypt_server_side_across_configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:49:37 DEBUG : config1: detected overridden config - adding "{Db_Y9}" suffix to name
2023/01/05 08:49:37 DEBUG : Setting crypt_server_side_across_configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:49:37 DEBUG : Creating backend with remote "bare:dir1/0a1lv6uu4en1n1nc7hnd7805sk"
2023/01/05 08:49:40 DEBUG : fs cache: adding new entry for parent of "bare:dir1/0a1lv6uu4en1n1nc7hnd7805sk", "bare:dir1"
2023/01/05 08:49:40 DEBUG : fs cache: adding new entry for parent of "config1:/git-log.txt", "config1{Db_Y9}:/git-log.txt"
2023/01/05 08:49:40 DEBUG : Creating backend with remote "config2:/"
2023/01/05 08:49:40 DEBUG : Setting crypt_server_side_across_configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:49:40 DEBUG : config2: detected overridden config - adding "{Db_Y9}" suffix to name
2023/01/05 08:49:40 DEBUG : Setting crypt_server_side_across_configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:49:41 DEBUG : Creating backend with remote "bare:dir2"
2023/01/05 08:49:42 DEBUG : fs cache: renaming cache item "config2:/" to be canonical "config2{Db_Y9}:/"
2023/01/05 08:49:43 DEBUG : git-log.txt: Need to transfer - File not found at Destination
2023/01/05 08:49:44 DEBUG : 0a1lv6uu4en1n1nc7hnd7805sk: Starting multipart upload
2023/01/05 08:49:45 DEBUG : 0a1lv6uu4en1n1nc7hnd7805sk: Uploading segment 0/4370 size 4370
2023/01/05 08:49:45 DEBUG : git-log.txt: sha1 = 034806b5196b2424ffc974043fc5ad7aba20bde1 OK
2023/01/05 08:49:45 INFO : git-log.txt: Copied (new)
2023/01/05 08:49:45 INFO :
Transferred: 4.268 KiB / 4.268 KiB, 100%, 2.125 KiB/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 8.6s
then I tried to only change 1 parameter (as rclone doc said), makes config2 has dir encryption turned off. since I'm coping files under root dir, thus such config shouldn't change anything. I delete target file from config2, rerun rclone copy command
2023/01/05 08:59:55 DEBUG : Setting default for crypt-server-side-across-configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:59:55 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "copy" "config1:/git-log.txt" "config2:/" "-vv"]
2023/01/05 08:59:55 DEBUG : Creating backend with remote "config1:/git-log.txt"
2023/01/05 08:59:55 DEBUG : Using config file from "C:\\Users\\comicfans.DESKTOP-35AEQ6R\\.config\\rclone\\rclone.conf"
2023/01/05 08:59:55 DEBUG : Setting crypt_server_side_across_configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:59:55 DEBUG : config1: detected overridden config - adding "{Db_Y9}" suffix to name
2023/01/05 08:59:55 DEBUG : Setting crypt_server_side_across_configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:59:55 DEBUG : Creating backend with remote "bare:dir1/0a1lv6uu4en1n1nc7hnd7805sk"
2023/01/05 08:59:58 DEBUG : fs cache: adding new entry for parent of "bare:dir1/0a1lv6uu4en1n1nc7hnd7805sk", "bare:dir1"
2023/01/05 08:59:58 DEBUG : fs cache: adding new entry for parent of "config1:/git-log.txt", "config1{Db_Y9}:/git-log.txt"
2023/01/05 08:59:58 DEBUG : Creating backend with remote "config2:/"
2023/01/05 08:59:58 DEBUG : Setting crypt_server_side_across_configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:59:58 DEBUG : config2: detected overridden config - adding "{Db_Y9}" suffix to name
2023/01/05 08:59:58 DEBUG : Setting crypt_server_side_across_configs="true" from environment variable RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
2023/01/05 08:59:58 DEBUG : Creating backend with remote "bare:dir2"
2023/01/05 09:00:00 DEBUG : fs cache: renaming cache item "config2:/" to be canonical "config2{Db_Y9}:/"
2023/01/05 09:00:01 DEBUG : git-log.txt: Need to transfer - File not found at Destination
2023/01/05 09:00:02 DEBUG : 0a1lv6uu4en1n1nc7hnd7805sk: Starting multipart upload
2023/01/05 09:00:02 DEBUG : 0a1lv6uu4en1n1nc7hnd7805sk: Uploading segment 0/4370 size 4370
2023/01/05 09:00:03 DEBUG : git-log.txt: sha1 = f8b38254e37d92ee6fef928e25a482f4aa9f05b3 OK
2023/01/05 09:00:03 INFO : git-log.txt: Copied (new)
2023/01/05 09:00:03 INFO :
Transferred: 4.268 KiB / 4.268 KiB, 100%, 0 B/s, ETA -
Transferred: 1 / 1, 100%
Elapsed time: 8.2s
2023/01/05 09:35:22 DEBUG : git-log.txt: Need to transfer - File not found at Destination
2023/01/05 09:35:23 INFO : git-log.txt: Moved (server-side)
I still not narrow down which arguments (onedrive-server-side-across-config/server-side-across-config/crypt-server-side-across-config) makes it work, but at least currently specified all these arguments makes server side move work.
but it still seems wired, move can using server side copy, but copy can not ? onedrive does not support server side copy ? or is this a rclone logic restriction ?