Initializing ownCloud via FTP

Hi all,

Context: fresh ownCloud installation with latest version

As the data folder is currently empty, I'd like to initialize it with a copy of all files from our NAS (Synology). I've tried opening a webdav channel, but it fails on the NAS side... Therefore, I'd like to use FTP as it works quite well on the machine.

My question: is the following procedure possible?
* connecting the NAS as an external storage, using FTP
* copying all files from this external storage to the "normal" storage
* disconnect the NAS once it's done

Then, I'll probably want to synchronize the NAS with ownCloud once a week. Any advice on this is welcome!

Thanks in advance for any help!

Hi jlgarnier,

I would rather copy over all files from your NAS to the ownCloud primary storage by using rsync -t. This will make the data files to keep their original timestamp otherwise the sync clients will re-download all the files after the migration.

You will need then to run occ files:scan --all in order to rescan the filesystem and update the file cache in order to make ownCloud aware of the new files.

Thanks a lot pako for your answer!

Being quite a newbie with Linux, I'll try to summarize what I understand from this method:

  • I need to open a console onto the NAS.
  • Then I need to rsync -t source_dir_on_NAS target_dir_on_cloud
    ** Q1: how can I determine the source folder on the NAS?
    ** Q2: how do I "translate" the target folder on the cloud into a well-formed URL? I mean: the target folder is on a secondary disk on my private virtual server, mapped to /media/diskext/oc/data. I suppose I will need to rsync with something like https://myvps.com/targetdir --> what is the Linux command that I need to use to convert a "local folder path" into an "internet folder path"?

Then I suppose the rsync will operate directly between the NAS and the cloud, with no action from my laptop?

Thanks in advance for your help!

Hy Jean-Luc
Usually you use the IP address of your virtual server with ssh. Please don't use ftp, it is really poorly secure.
The syntax is more or less
rsync -aPz -e ssh nameofdir/ user@IP:/media/diskext/oc/data
You use this command from you NAS, and in the directory where the directory containing the files is.
"user" is an authorized user on the server
Beware of the fact that "user" must have the rights to write on the directory target.
If you do it once, manually, you will be prompted for the password of "user" on the server. If you intend to do it recursively, it might be better to install a ssh key.
As far as I remember -aPz allow for the files to be compressed and it use the archive mode where the attributes of the files (timestamp, ownership for instance) are transferred. P might not be necessary it is for the handling of partially transferred files.

Thanks a lot René!

I'm currently trying to copy some files using webDAV channel, which I finally managed to setup. Right after this copy, I'll open a SSH console to the NAS and will try to rsync, using your parameters, and will let you know of the result.

Talk to you soon!

René, it works perfectly with your command! Thanks a lot! You really saved me on this topic, as I was losing ages in webdav transfer!

Thanks again!