Reinstall of Nextcloud but with old data


I am new here and was hopping for a point in the right direction.

I had Nextcloud up and running but a mess up with software caused the partitions on the server to be rewritten.
So I lost the installation and its database before I could back it up. So I am working to rebuild the nextcloud server.

I kept the data folder, and therefore all of the data, on an exteral NAS and it is all intact. It is 38 gb worth of data spread over 2 user accounts, and I am trying to figure out how to reconstitute it.

I have reinstalled Nextcloud using Snap

I am trying to find a way to get the new installation to recognize the data in the 2 old accounts and use that. That way it doesn’t try to delete or overwrite it, and hopefully it doesn’t think it needs to re-sync it to the computers.

I found this tutorial:

But it only seems to deal with new data being brought into a Nextcloud system. Whereas mine is old Nextcloud data I need to bring into a fresh install.

Thanks for any help,

  • Jon

under normal circumstances you can install nextcloud into an old/existing directory.
BUT you should keep in mind, that to move away or rename the old config.php and use exact the same usernames.
If do so every thing should work fine.

You can also rename your old directory and make a fresh install into a new directory with the old name.
After that you can easily copy your data files from the old data dir to the new one.
May be that is the best way.

If you have sync clients connected you should not have to copy nothing. The client will ask you if to delete the old files or to sync them. Choose sync :wink:



Thanks for the reply! -]

I ended up installing a new version with snap.

I then ended up rsync-ing the files over into the data/username/files folder (basically you 2nd suggestion)
Then forced a re-scan with:
sudo nextcloud.occ files:scan --all

That worked, and the sync to the client recognized everything :grin:

Thanks for the reply -]