NextcloudPi Rsync from one server to another

Hi guys.

I am trying to sync one nextcloudpi server with another. For now in the same network but eventually I want to place it somewhere else so I can continue accessing my data in case of any hardware or connection failure.

  • create backup with data
  • import backup with data on the second server
  • Configure second server (certificate, etc)
  • after commenting the memcache.local line

‘memcache.local’ => ‘\OC\Memcache\APCu’,

I was able to login with the same users.

Now I added another file to the first server and would like to add this on the new server also with nc-rsync. But now I run into some issues, I think it is related to permissions of the ncdata folder as they are owned by www-data and I use the pi user for rsync.

The rsync script which is used can be found here:

rsync: change_dir#1 “/media/drive/ncdata” failed: Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(632) [Receiver=3.1.2]
Nextcloud is in maintenance mode - no apps have been loaded

Maintenance mode disabled
Done. Press any key…

I have been testing and trying and by executing below steps I can copy all files from a single user to the second nextcloud server.

  1. Rsync folder for user on Instance1
    root@nextcloudpi:/media/drive/ncdata# rsync -av -e ssh --rsync-path=“sudo rsync” ./User1 pi@IPofbackupserver:/media/drive/ncdata
  2. Fill in password when prompted
  3. Instance2: Run NC-scan to scan for externally modified files

At the moment I am still testing to check for file permissions and other stuff. If that is all ok I will try to generate a private/public pair of keys to allow a ‘ssh’ connection without asking for a password. If someone has tips, feel free to comment :slight_smile: