i made a terrible mistake in deleting partially the nextcloud folder at /var/www/nextcloud. it took me maybe a second or two until i recognized the fatal error… what seems to be restored are the following files:
3rdparty AUTHORS config core data ocm-provider public.php version.php
the rest is gone. since i only installed nextcloud today there are not so many files that got deleted. does it make sense to reinstall nextcloud completely? could i possibly resore the data folder? in either case, what has to be done?
Do not put DATA folder inside the nextcloud folder.
It’s a real security risk for your files !
You have to create a data folder somewhere else :
Like /data
Or /home/data
Then appli chown -R www-data:www-data on this folder
When installing nextcloud you have to give the good path of data folder.
Good practice 2 :
Always have a backup of :
Your data folder
Your nextcloud folder (containing config folder)
Your database
So you if your data folder has gone… you better start from scratch.
After your installation will be up again -> go and try to make backups of your installation.
And make some tests
Delete the data folder then restore your backup etc…
Before making the dump, it is preferable to put your nextcloud instance into MAINTENANCE MODE
You can enable maintenance mode by enabling it in the config file or by the occ command.
i reinstalled nextcloud, ran through the setup wizzard and created a temporary user. i moved the old data folder to another location. moved the existing folders/files to the new nextcloud folder (3rdparty AUTHORS config core data ocm-provider public.php version.php) updated the config file with the new data location, checked the ID in the config file which matches the ID in the datafolder. i tried to access the page in the browser and got this error message:
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
could not figure out where the server log is.
but maybe it makes more sense to do the installation from scratch. as i already mentioned, it’s not a significant loss of data. however, during the second installation i could not chose the username i used during the first installation. how can i erase the protocol that says this user has already been taken?
You have to use the program mysql for talking with it.
Make research on internet but a sumery could be :
mysql -u root -p
(login)
show databases;
(you see the list of database, you see that your nextcloud database is named for exemple : ncDB)
drop database ncDB;
(Your database is gone)
exit