Iâm checking the right server, am I missing something? Sorry for my lack of experience, I may just end up having to reinstall Nextcloud. Hope not, though, itâs working.
Thatâs odd. If Nextcloud is working, there has to be a database. Check your config/config.php file for the database type, location, and credentials. It looks something like this,
/var/www/nextcloud/config/config.php doesnât even specify a database name. I know itâs working though because I added maintenance mode, switched it to âtrueâ, and the site properly locked me out.
<?php
$CONFIG = array (
'instanceid' => 'zzzzzzz',
'passwordsalt' => 'zzzzzzzzzz',
'secret' => 'zzzzzzzzzzzzzzzzzz',
'trusted_domains' =>
array (
0 => 'xxx.xxx.xxx.xxx',
1 => 'share.mydomain.com',
),
'datadirectory' => '/var/www/nextcloud/data/',
'overwrite.cli.url' => 'http://xxx.xxx.xxx.xxx/nextcloud',
'dbtype' => 'sqlite3',
'version' => '9.1.0.16',
'logtimezone' => 'UTC',
'installed' => true,
'mail_smtpmode' => 'smtp',
'mail_from_address' => 'user',
'mail_domain' => 'mydomain.com',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_smtphost' => 'mail.mydomain.com',
'mail_smtpsecure' => 'tls',
'mail_smtpname' => 'user@mydomain.com',
'mail_smtppassword' => 'mypassword',
'mail_smtpport' => '25',
"maintenance" => false,
);
I also did a SHOW DATABASES and received exactly the same as what phpmyadmin was showing:
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
+--------------------+
4 rows in set (0.00 sec)
But Nextcloud is honestly working just fine. This seems crazy. ANY ideas on what might be happening?
Itâs using sqlite instead of Mysql/MariaDB. I think the database will be located in your $data directory and will be a file ending with .db. Iâm not entirely sure, as Iâve never configured sqlite before.
At that point my Nextcloud database was accessible through phpmyadmin. Then I followed grouchysysadminâs steps above:
0: Back everything up first.
1: Disable access to Nextcloud. (maintenance mode)
2: Move the data folder.
3: Edit the database table oc_storage. Change the local::/path/to/data to local::/new/path/to/data.
4: Edit the config.php datadirectory line to reflect the new path.
5: Turn off maintenance mode.
In my case, I move the data directory to /etc/nextclouddata/nextcoud/data. When trying to load my login page for the first time, I got the following error:
Data directory (/etc/nextclouddata/nextcloud/data/) is invalid. Please check that the data directory contains a file â.ocdataâ in its root.
If you do not have PHPmyAdmin running on your webmin, you can always manage the database under servers->mysql database-> select your db->manage db->select oc_storages in edit db->click view data->select the row with the local:: and edit->set the new value and save.
So Iâve been struggling with moving my data directory, as well, in NC v11. My vm test went well, then a trial run on real host to tinker with; and finally, a working, live installâŚand then I realized I didnât give enough room for data storageâŚI have a 2TB external drive.
I have made several attempts, but ran into all the same issues you have with permissionsâŚany idea if this will work in v11?
(This instance is very young: it could be wiped and reinstalled, pointing to the new storage, but Iâd like to figure out how to move the data manuallyâŚat some point in the future, somebody is going to have to upgrade their storage⌠might as well find out how).
When moving the data folder to an external drive, make sure you used the correct user to mount the driveâŚ
(Even format as the user depending on the filesystem.)
If default installation means apache webserver, it must be www-data as this it the default web user that is used by nextcloud to write your data. Nextcloud has thanks god no access to the root user ;).
I must have missed somethingâŚI log in as root, cp the âŚ/data folder to the new location, but when I run the chown command, it says âoperation not permittedâ. Suggestions?
I have been struggling with this issue all week and finally came across this very useful thread. Thanks to all contributors. However, after going through the various items listed above in robertbâs posting of Sep '16 I still had the mentioned error :
Data directory (/etc/nextclouddata/nextcloud/data/) is invalid. Please check that the data directory contains a file â.ocdataâ in its root.
I had learnt in other attempts that the nextcloud.conf has also to be modified by adding the new data directory path as follows (using robertbâs data directory as an example) :
Hi, I have the latest version of Nextcloud running on Raspbian. I tried to change the path of the data directory. I moved all /mnt/dietpi_userdata/nextcloud_data files to /mnt/myexternaldrive/nextcloud, then do chown -R www-data:www-data, changed settings in config.php and in oc_storage in the database.
I still get Data directory (/mnt/myexternaldrive/nextcloud) is invalid. Please check that the data directory contains a file â.ocdataâ in its root.