I have to migrate an existing folder on one Nextcloud instance to another Nextcloud instance. Since it is only one folder (with many subfolders and files) of about 2 GB size, I would like to
either download it as a compressed file from the one Nextcloud instance, upload the file to the other instance, decompress and encrypt it there directly on the server via shell
or transfer the folder directly from one server to the other over scp and have it decrypted on the one server and encrypted on the other server.
Of course, an alternative would be to download the folder as compressed archive via web front-end from one server, unzip it locally and upload the contents to the other server via web front-end again. However, the upload would take much longer this way.
Is it possible or are there alternative approaches?
Copying files from one server to another is, in a first step, independent from Nextcloud, because it happens on the file system layer. Nextcloud supports to update its database by execution the "files:scan [options] [--] [<user_id>...]" command.
So the right way to go is
copy the files to the new server
adjust the directory and file access rights
execute the occ command to update the Nextcloud database
Thanks for your quick response! What about the decryption/encryption of the files? How can the files be decrypted and re-encrypted with the new key on the target server in way compatible with Nextcloud?
What about the decryption/encryption of the files? How can the files be decrypted and re-encrypted with the new key on the target server in way compatible with Nextcloud?
Are you really using Nextcloud’s file encryption on your servers? You haven’t mentioned this in your original post!