Trouble migrating NextCloud site new host

I recently had to move my personal NextCloud instance off of my WebFaction account to a new account at OpalStack. OpalStack is billed as a WebFaction replacement and so far the two accounts have been very similar. All my other PHP apps were migrated without issue.

I followed the steps here to migrate my instance - https://docs.nextcloud.com/server/latest/admin_manual/maintenance/migrating.html - with the only exception I may have forgotten to turn on maintenance mode prior to dumping the database. I do know for certain I had maintenance mode on when I copied the files to the new machine. I also know that at most I had one active client at the time of the migration as all my other clients were physically powered off.

Step 5 is where things fell apart for me. I was never able to get the maintenance mode message on the new instance and I ran out of time debugging before WebFaction shut down my old account (all WebFaction accounts got shutdown on 12/9/20).

Even with maintenance mode on I get an exception when access the site, and with maintenance mode off I get the same exception with occ:

TypeError: Argument 1 passed to OC\Files\SimpleFS\SimpleFolder::__construct() must implement interface OCP\Files\Folder, instance of OC\Files\Node\File given, called in /home/stratus_jason/apps/cloud/lib/private/Files/AppData/AppData.php on line 150 and defined in /home/stratus_jason/apps/cloud/lib/private/Files/SimpleFS/SimpleFolder.php:44
Stack trace:
#0 /home/stratus_jason/apps/cloud/lib/private/Files/AppData/AppData.php(150): OC\Files\SimpleFS\SimpleFolder->__construct(Object(OC\Files\Node\File))
#1 /home/stratus_jason/apps/cloud/lib/private/Template/IconsCacher.php(88): OC\Files\AppData\AppData->getFolder('icons')
#2 [internal function]: OC\Template\IconsCacher->__construct(Object(OC\Log), Object(OC\Files\AppData\Factory), Object(OC\URLGenerator), Object(OC\AppFramework\Utility\TimeFactory))
#3 /home/stratus_jason/apps/cloud/lib/private/AppFramework/Utility/SimpleContainer.php(84): ReflectionClass->newInstanceArgs(Array)
#4 /home/stratus_jason/apps/cloud/lib/private/AppFramework/Utility/SimpleContainer.php(101): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
#5 /home/stratus_jason/apps/cloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\Template\\Ico...')
#6 /home/stratus_jason/apps/cloud/lib/private/ServerContainer.php(149): OC\AppFramework\Utility\SimpleContainer->query('OC\\Template\\Ico...', true)
#7 /home/stratus_jason/apps/cloud/lib/private/Server.php(1145): OC\ServerContainer->query('OC\\Template\\Ico...')
#8 /home/stratus_jason/apps/cloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#9 /home/stratus_jason/apps/cloud/lib/private/ServerContainer.php(124): Pimple\Container->offsetGet('OC\\Template\\SCS...')
#10 /home/stratus_jason/apps/cloud/lib/private/Repair.php(150): OC\ServerContainer->query('OC\\Template\\SCS...')
#11 /home/stratus_jason/apps/cloud/core/Command/Maintenance/Repair.php(83): OC\Repair::getRepairSteps()
#12 /home/stratus_jason/apps/cloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Repair->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /home/stratus_jason/apps/cloud/3rdparty/symfony/console/Application.php(1012): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /home/stratus_jason/apps/cloud/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Repair), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /home/stratus_jason/apps/cloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /home/stratus_jason/apps/cloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /home/stratus_jason/apps/cloud/console.php(100): OC\Console\Application->run()
#18 /home/stratus_jason/apps/cloud/occ(11): require_once('/home/stratus_j...')

I’m at a loss as to what is causing this. As far as I can tell everything on the new instance is present and configured correctly. I know for certain I am using the same PHP version as the old instance. I’m using the same database as well (Postgres).

PHP Version:

PHP 7.3.25 (cli) (built: Nov 24 2020 11:10:55) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.3.25, Copyright © 1998-2018 Zend Technologies
with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright © 2002-2020, by ionCube Ltd.
with Zend OPcache v7.3.25, Copyright © 1999-2018, by Zend Technologies

NextCloud version: 19.0.4.2

Any suggestions would be welcome! Even just knowing what to look at or what to try would be helpful.

When in maintenance mode I can run:

./occ integrity:check-core
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud is in maintenance mode - no apps have been loaded

No issues other than memory are reported, and I got the same warning about memory on my old server.

Turns out this issue was due to an incomplete database import from the old instance. I suspect the web-based SQL GUI timed out during the upload f the database dump and left me with a half populated database.

Moral of the story: don’t do migrations late at night, and when dealing with failures manually check for database integrity.

1 Like

Same situation just happened to me. Seems like the updater got stuck at a certain moment, leaving behind an unfinished state (file-system- and database-wise). In this chaos-sphere, multiple things came together as I took sight of this issue: Problems with PHP 7.4 (which I had meanwhile forgotten to have updated), outdated backup of the database, and me thinking that this problem would be related to any third-party app (thus disabling all apps step by step) or 3rdparty vendor.

Solution: Double-check your backups before updating; try not to use GUI-based updater.

This topic was automatically closed after 20 hours. New replies are no longer allowed.