Move from owncloud to nextcloud - Import Data

Dear Community,
I was backing up my owncloud before migrating to nextcloud, however I only backed up the data folder and I did not back up the databases. The files has been transferred now however I cannot just put them back into the files/ folder, nextcloud will not recognize my file. What should I do?
Nextcloud is set up. (databases, webserver,etc)

You should be able to move your data into the data dir under the relevant user and perform an occ files scan.

cd /path/to/nextcloud/
sudo -u www-data php occ files:scan --all

Thank you. However, now I get the error of You don’t have permission to upload or create files here.
I tried the script from the admin manual, it give me the following error:
bash: ./script.sh: Permission demied

You need to ensure the webserver user (Apache, www-data, whoever) owns and can write to the data directory, eg

sudo chown -R www-data:www-data /path/to/data/dir

HI @JasonBayton , I know I am replying to a very old thread.

I tried this and when I do this, I am seeing 2 issues:

  1. it scans not all the files, but only the one folder which has user account folder (admin) and not all the other account folders within the folder.

  2. The files scanned do not show up on the nextcloud portal when I login.

I am on version 20.0.2

please advice, help!