GroupFolders not working after moving data to a new machine

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.0.13
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 7.4

The issue you are facing:

I have an instance of Nextcloud 25.1 on a machine that I must replace. I’ve installed a 25.1.3 version on a new machine. On this new installation, I’ve set up a data folder and this is working. Then I added an extra HD to store data and copied all the main server files to it. When I change “datadirectory” on the config file to this new data folder, Nextcloud crashes and I cannot login anymore.
When this happens, I disable the app groupfolders with occ and then I manage to login again.
I can use this new data folder if the app groupfolders is disabled, all the files are there and I can see and use them.
The groupfolder from the new installation works fine, only the groupfolder on the new disk doesn’t.
I’m getting mad here and I couldn’t find a solution on this forum or on Google and I even talked to some folks that also use Nextcloud but to no avail.
If anybody could help in anyway I would be very greatful.

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

Steps to replicate it:

  1. Installed a new server with the same version of the old server
  2. Restored the database (MySQL)
  3. Pointed the datafolder to a new directory with the original files from the old server

The output of your Nextcloud log in Admin > Logging:

[index] Erro: Exception: Typed property OCA\GroupFolders\Helper\LazyFolder::$folder must be an instance of OCP\Files\Folder or null, OC\Files\Node\File used in file '/var/www/html/nextcloud25/apps/groupfolders/lib/Helper/LazyFolder.php' line 43 at <<closure>>

0. /var/www/html/nextcloud25/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch()
1. /var/www/html/nextcloud25/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main()
2. /var/www/html/nextcloud25/lib/base.php line 1053
   OC\Route\Router->match()
3. /var/www/html/nextcloud25/index.php line 36
   OC::handleRequest()

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

$CONFIG = array (
  'instanceid' => 'XXXXXXXXXXX',
  'passwordsalt' => 'XXXXXXXXXXX',
  'secret' => 'XXXXXXXXXXX',
  'trusted_domains' => 
  array (
    0 => 'XXXXXXXXXXX',
  ),
//  'datadirectory' => '/var/www/nextcloud-data-25',
  'datadirectory' => '/mnt/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '25.0.13.2',
  'overwrite.cli.url' => 'XXXXXXXXXXXX',
  'dbname' => 'XXXXXXXXXXXX',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'XXXXXXXXXXXX',
  'dbpassword' => 'XXXXXXXXXXXX',
  'installed' => true,
  'maintenance' => false,
  'defaultapp' => 'dashboard',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 3,
  'log_type' => 'file',
  'logfile' => '/mnt/nextcloud/data/nextcloud.log',

);

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

No error on Apache logs

hi @facb69 welcome to the forum :handshake:
Please follow the official server migration procedure Migrating to a different server — Nextcloud latest Administration Manual latest documentation and once successful upgrade to a maintained version.

Thanks @wwe for the answer.
I’ve just managed to workaround the issue by creating a hyperlink on the original directory to the new directory.
Now groupfolders are working! I can’t understand why though.
I’ll take a look at the tutorial you mentioned.
Again, I thank you for the attention and help.
This topic can be closed. :grinning:

It sounds like you changed the location of your datadirectory. You have to take additional steps when doing that:

https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#troubleshooting-data-directory

The symlink is one of those approaches.

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