Using nextcloud to replace ftp server

Hi, everybody here!

I have lots of files on a ftp server (>3TB), and I am tired of searching files on it. So I decided to replace it with nextcloud. But I don’t know how to migrate those data to nextcloud.

The nextcloud server would be deployed just the same server as the ftp server, so the most convinent way is serving on the original data directory tree. I know that nextcloud only show files with records in database, so I’ve tried to copy an file to the data directory and insert an record in the table activity, with similar data with the default ones, but it just doesn’t work.

The last record in this picture is what I inserted and the psb.jpg just didn’t show up.

@table activity| center

If I want to use an existing file directories as my data directory, which tables should I modified?


you should try:

  • occ files:scan --all
  • occ files:cleanup

See here for more details how to run these commands and for the user:

If you add your storage as external storage the refresh should also work. Besides my normal data directory I have added a directory as external storage. If I place documents there (on file system level) they show up in Nextcloud without performing any re-scan.


1 Like

you can copy/move all files to ///files/ and run

su -s /bin/bash www-data -c “php /var/www/nextcloud/occ files:scan --all”

replace “/var/www/nextcloud” with the path to your nextcloud installation. and www-data with the user running your web server.

or you can configure the data directory of your ftp server as external storage. and run “occ files:scan”

1 Like

Wow! Thank you for your nice help! You two just save my day! :grinning:

Please forgive for my too late reply, cause we may have eight hours of jet-lag :joy: