How to easily transfer 800 GiB+ of data to nextcloud

Hi everyone, have about 600 GiB of pictures and then another 200 GiB for my personal media server. Obviously, it isn’t very effective to just drag and drop that amount of data into nextcloud. I want to be able to plug in an external HDD to the server and transfer that data in.

I tried to go through Nextcloud and the files app, but neither would show the external drives. Am I missing something here? Is there a way to view external USB devices on nextcloud or files?

I also tried to go through command line but I can’t figure out the login credentials. I got the password, but I can’t get the username right. I tried root, admin, start9, all to no avail. (P.S. I just disabled the graphical user interface on the server, no SSH.)

I also tried booting into lubuntu on a live USB. I figured I could just drag and drop the stuff from the external drive to the directory in StartOS that I want. However, StartOS encrypts the drives. When I tried to decrypt the drives, it wouldn’t work. I entered in the login password, but it wouldn’t work. Don’t know why, but it said it was the wrong password.

A proper solution to any one of these routes would fix my problem. Thanks!

I don’t believe it is possible at present to mount an additional drive to the server as you were attempting.

Instead I believe the easiest way to transfer data from an HDD to Nextcloud would be something like this:

  1. Mount the HDD to a laptop.
  2. SSH into your server from the laptop in step 1.
  3. Use rsync to copy the files from the HDD to the appropriate Nextcloud directory. As an example you might look at the command for copying the blockchain in step 7 of the raspiblitz migration guide. This would of course need to be modified to copy the files from the mounted HDD filepath and target the appropriate Nextcloud directory.
1 Like

Thanks for the solution. However, I think i found a simpler solution (at least for me). What I did was I wrote Lubuntu Linux onto a USB stick. I then booted into the USB stick instead of StartOS. I had previously tried this, but the problem was that I couldn’t access the StartOS drives because they were encrypted. However, from this question (After a botched Embassy OS update, want to copy files from the 1TB external drive) I was able to figure out that the default password was password. Once I found that, I simply plugged in my external drive to the server which I then decrypted on Lubuntu. I then opened the Lubuntu file explorer in root mode and started the transfer of all the data to the proper nextcloud directory (took me a bit to look for the multimedia folder that I had created earlier in Nextcloud, but I found it!)

1 Like

The drive is technically “encrypted,” but this should not be relied upon for any sort of security. Since it’s full drive encryption it’s not related to the user log in. The password is just “password” without the quotes. While I’ve never done it, I suspect your boot into a live USB should work. Another way might be to SSH into the box, and rsync from an external source.

1 Like

i am a noob, but after many tries and errors i managed to copy all my files from an external harddrive into nextcloud with ssh.

First i tried to copy a few files from my local pc to the home directory /home/start9/ of the start9server with the rsync command to check if the command would work. It was succesful, but if i tried to copy the whole external hard drive i would get errors about the destination drive not having enough space.

No space left on device (28)

I wasnt able to resolve this issue, although i had more then enough space on the harddrive of the server.
Later i thought i would try to copy everything in the nextcloud directories. But i did not know where to find these directories. But finaly i found them:

/embassy-data/package-data/volumes/nextcloud/data/nextcloud/data/your_account_at_nextcloud/files/

You can ls all the way to

/embassy-data/package-data/volumes/nextcloud/data/nextcloud

but after that if you want to ls into a deeper directory you get:

-bash: cd: data: Permission denied

I solved this problem by elevating myself to root by

sudo -i

now i could go deeper and find the destination directory where i wanted to copy my files to. But using ssh and rsync command on the commandline of my local pc like this:

rsync -avP /path/to/files/to/be/copied/ start9@ADJECTIVE-NOUN.local:/embassy-data/package-data/volumes/nextcloud/data/nextcloud/data/your_account_at_nextcloud/files/

would give me an error as i had no permission to copy to the destination directory. I read about chmod and other commands to change permissions on directories, but that was too difficult for me. I thought i should just elevate myself to root on the server and ls into the destination directory and use the rsync command from there like this:

rsync -avP --delete user@IP_adres_local_pc:/media/user/external_hard_drive/Documents /embassy-data/package-data/volumes/nextcloud/data/nextcloud/data/your_account_at_nextcloud/files

But this would also not work because i was ssh’ing back from the server to my local pc and my local pc was not enabled to receive ssh connection. So i had to enable that first. So on my local PC commandline i installed:

sudo apt install openssh-server

enable it:

sudo systemctl enable ssh

opening port 22 (in case of firewall or something):

sudo ufw allow ssh

checking the status of it:

sudo systemctl status ssh

So finally the above rync command worked. i checked it in the directory and everything seemed fine. But then if i would log in to nextcloud through the browser i could not detect the newly copied files. All this time, but still not usable if i cant seem to find them through the nextcloud app or browser.

So after searching the internet i understood that nextcloud indexes all the files that are uploaded to the server, but only indexes the files that are uploaded through the ‘official’ channels. These are through the webbrowser, the app or webDAV. ‘uploading’ through ssh is not recognized and therefor not indexed by nextcloud. So nextcloud is not aware that newly copied files are present.
So the solutions is to change the config file of nextcloud which can be found here on the server:

/embassy-data/package-data/volumes/nextcloud/data/nextcloud/config/config.php

by changing the following number 0 into 1 in the following line:

‘filesystem_check_changes’ => 0,

so the new line becomes:

‘filesystem_check_changes’ => 1,

And now nextcloud scans the directories for new files. Hurrah finaly everything worked. All files visible.

Wasn’t the word “easily” in the title of this? lol Congrats on getting it set. Pretty satisfying for sure! I think I would have just put all the data in a sync folder, and just waited it out. I’m petty sure that would have taken less than a year. :wink: