Data directory not found after installation - file .ocdata missing

[/details]

Nextcloud version (eg, 29.0.5): 29.0.10
Operating system and version (eg, Ubuntu 24.04): Linux 4.4.302+ #64570 SMP Tue Jun 13 21:40:17 CST 2023 x86_64 GNU/Linux synology_apollolake_718+
Apache or nginx version (eg, Apache 2.4.25): 2.4.58
PHP version (eg, 8.3): 8.2

The issue you are facing:
When moveing the datadirectory from the default location within the nextcloud-root directory to another location, the new location and .ocdata is not found. As long as the datadirectoy is in the default location, nextcloud runs normally.
config.php and oc_storage in the database are modified. The new folder has proper access-rights and ownership.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. I did a complete new installation of the nextcloud server (it’s my testsystem)
  2. I changed datadirectory in config.php and changed the oc_storages entry in the database
  3. I copied the data-folder to the new location, made chmod 777 and chown http:http (my webserver-user)
  4. Open nextcloud in browser and got the error in the web-interface, no entry in the nextcloud.log is found however

The output of your Nextcloud log in Admin > Logging:

can't see any error related to this issue - logfile is empty

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

(Following config.php is from my testsystem, which is whithout any additional app, just the plain nextcloud server.)

<?php
$CONFIG = array (
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'mydomain.de',
  ),
  'datadirectory' => '/volume1/nextcloud_datatest2',
  'dbtype' => 'mysql',
  'version' => '29.0.7.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'xxx',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'xxx',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
);

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

logfile nextcloud.log in new datadirectoy exists, but is empty

datadirectory:
xxx@xxx:~$ ll /volume1/nextcloud_datatest2
total 4
drwxrwx— 1 http http 128 Sep 27 20:20 .
drwxr-xr-x 1 root root 1414 Sep 26 22:02 …
drwxrwxrwx 1 http http 10 Sep 27 20:19 xxx
drwxrwxrwx 1 http http 38 Sep 27 22:35 appdata_xxx
-rwxrwxrwx 1 http http 542 Sep 27 20:19 .htaccess
-rwxrwxrwx 1 http http 0 Sep 27 20:19 index.html
-rwxrwxrwx 1 http http 0 Sep 27 20:20 nextcloud.log
-rwxrwxrwx 1 http http 0 Sep 27 20:19 .ocdata
xxx@xxx:~$

database oc_storages:
local::/volume1/nextcloud_datatest2/

Additional information:
I tried multiple times with new installation of my testsystem, with the web-installer but also command-line installation. It’s no difference. As long as the datadirectory is in the default location (root-nextcloud/data) the system runs fine. I run nextcloud since years and never had such difficulties to move the datadirectory. I’m somehow lost after reading all the posts in the community-support about this topic and have no idea anymore. Maybe just a small thing I do not recognize at the moment. Any help is welcome.

When you copied did you also copy .* files? If not, the .ocdata was not included in the copy/move. That’s the first thought that comes to mind. I see people do cp -a * target all the time that overlook this so you would not be alone. :slight_smile:

Thanks. Yes I copied the .* files seperatly.

This is the current content of my datafolder - looks good from my point of view:

xx@xx:~$ ll /volume1/nextcloud_datatest2
total 4
drwxrwx— 1 http http 128 Sep 28 16:12 .
drwxr-xr-x 1 root root 1414 Sep 26 22:02 …
drwxrwxrwx 1 http http 10 Sep 27 20:19 xxx
drwxrwxrwx 1 http http 38 Sep 27 22:35 appdata_xxx
-rwxrwxrwx 1 http http 542 Sep 27 20:19 .htaccess
-rwxrwxrwx 1 http http 0 Sep 27 20:19 index.html
-rwxrwxrwx 1 http http 0 Sep 27 20:20 nextcloud.log
-rwxrwxrwx 1 http http 0 Sep 27 20:19 .ocdata

Oh oops. I now see you even posted a directory listing with it previously too. My bad.

Couple thoughts:

  • Are you perhaps storing a backup config file within config/? If so, unless it is named carefully it’ll be merged with (and take priority over where there is overlap) the config.php due to Nextcloud’s multi-config file support. You can also check the real/merged config by running occ config:list system (w/ --private if you want to see anything uncensored in it for your own consumption)
  • you can temporarily add a logfile directive that places your nextcloud.log somewhere other than your new/old data directory. Even /tmp should work. That was you can see if there are more hints in it about what’s going on.

I found the reason for my problem: PHP open_basedir setting was wrong :frowning: .
It pointed to a previously used datadirctory. Now my testsystem is back and running. Thx for your support.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.