How do I move the webpage folder and not have to create a new database?

I would like to move the Nextcloud webpage folder from /var/www/nextcoud to var/www/html/nextcloud.

I moved the folder, updated the ā€œsites-availableā€, and when I go to the web browser page, Nextcloud is asking to configure a new database.

How do I move the webpage folder and keep the same database?

Note: Installed via Snap.

I moved the webpage folder, and now Nextcloud is asking to create a new Admin account and a new database. Nextcloud is acting like a new installation.

Looks l if you move the webpage folder, this also moves the data folder, and there are many threads how moving the data folder causes critical problems.

Because you didnā€™t change the datadirectory in config.php.

Database location:
image

config.php:
image

web login:
Notice it wants to create an admin account.

I know NextCloud knows where the database is because when I try to create a new admin account, Nextcloud produces the error message the admin username already exists:

This tells me Nextcloud is not installedā€¦but it was as you can see from the config.php file:

What else can I check?

Sorry i was too quick in answering your question. :wink:
Of course datadirectory has nothing to do with that and itā€™s also a bad idea to put the datadirectory under the webroot directory. Better would be a location somewhere out of it.

DocumentRoot is now /var/www/html, isnā€™t it?
What was is before?