How to migrate my NCP from one machine to another

I have NCP on Docker on a machine that needs to retire.
I have a Raspberry Pi 4B that will be the host for my next NCP.
What is the best way to migrate the Data from the retiring machine to the RPi?
Thanks

I would use rsync to copy ncdata from old to new drive,then start a fresh containter using the the new data folder location using the -v option.

Hi @OliverV
Thank you for your help.
To verify
While I am inside the docker ncp instance on the retiring machine, use rsync to copy the ncdata folder directly to the RPi ?
On my RPi does it matter if I use NCP docker or NCP RPi image(I think I preffer using the RPi image)

Could you please share what is the rsync command I should use?

Many thanks

I’d use

rsync -avh --progress /source/dir/ncdata /destination/dir/ncdata.

But it will not work from within the container, you have to run it as root or use sudo from the system terminal. Did you use the -v option to mount ncdata to a folder? If so that is where data will be stored. If not, depending systems in one of dockers subdirectories.

If you are migrating from a docker to an image installation, it will not be as simple as that.
In that case you will have to edit config.php manually to adjust PATH to ncdata , tmp & db directories. And run nc-scan to update database.
How many users, how much data do you have?

NCP’s nc-backup and nc-restore are available in docker. I’d start by making backups.

@wisdomlight

Please read documentation to backup and restore. Yes it is docker and it differs, but perhaps it helps you.

https://docs.nextcloud.com/server/19/admin_manual/maintenance/backup.html
https://docs.nextcloud.com/server/19/admin_manual/maintenance/restore.html

ok thank you
its only one user with not such a big files folder.
I located it in var/www/nextcloud/data/user-name/files
so I archived the files folder with tar -czf.
I suppose I can copy that and then unzip it in the new system??
it will probably be the easiest for someone like me with not much know how.

Thank you @devnull
I will read the docs
But I suspect I will take the crude method of archiving the files folder from the docker instance
move it to it host OS
copy it to an external HD
create a new RPi with NCP image
and I am not sure how but I will copy the fils from the HD to the new files folder in the new NCP instance.
Simple and crude but I that’t what I know how to do…:slight_smile:

It is only important that you learn something.

1 Like

Thanks for this. You are right.

1 Like