Database convert error

I have been running v13 for a few years, recently upgraded to 15 and trying to migrate to MySql database. Fatal error reported. I have basic experience, I suspect the issue is what appears to be a PHP ‘mismatch’ - 4.4.9 and 7.2. I am running on 1&1 IONOS - can’t change a lot of setting.

Nextcloud version (eg, 12.0.2): 15
Operating system and version (eg, Ubuntu 17.04): debian 8
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1): 7.2 (hosting company setting)

The issue you are facing:

(uiserver):u37714582:~/nextcloud$ php occ db:convert-type --all-apps mysql username host.com password

X-Powered-By: PHP/4.4.9

Content-type: text/html

<br />

<b>Fatal error</b>: main() [<a href='function.require'>function.require</a>]: Failed opening required '__DIR__/console.php' (include_path='.:/usr/lib/php4.4') in <b>/homepages/35/d120461270/htdocs/nextcloud/occ</b> on line <b>11</b><br />

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

The output of your Nextcloud log in Admin > Logging:

no app in context	Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "ocs.provisioning_api.AppsController.disable" as such route does not exist.
/homepages/35/d120461270/htdocs/nextcloud/lib/private/Route/Router.php - line 337:
Symfony\Component\Routing\Generator\UrlGenerator->generate("ocs.provisi ... e", { app: "next ... "}, 1)
/homepages/35/d120461270/htdocs/nextcloud/lib/private/URLGenerator.php - line 95:
OC\Route\Router->generate("ocs.provisi ... e", { app: "next ... "}, false)
/homepages/35/d120461270/htdocs/nextcloud/apps/nextcloud_announcements/lib/Notification/Notifier.php - line 89:
OC\URLGenerator->linkToOCSRouteAbsolute("provisionin ... e", { app: "next ... "})
/homepages/35/d120461270/htdocs/nextcloud/lib/private/Notification/Manager.php - line 226:
OCA\NextcloudAnnouncements\Notification\Notifier->prepare(OC\Notification\Notification {}, "en")
/homepages/35/d120461270/htdocs/nextcloud/apps/notifications/lib/Controller/EndpointController.php - line 92:
OC\Notification\Manager->prepare(OC\Notification\Notification {}, "en")
/homepages/35/d120461270/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 166:
OCA\Notifications\Controller\EndpointController->listNotifications("v2")
/homepages/35/d120461270/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 99:
OC\AppFramework\Http\Dispatcher->executeController(OCA\Notifica ... {}, "listNotifications")
/homepages/35/d120461270/htdocs/nextcloud/lib/private/AppFramework/App.php - line 118:
OC\AppFramework\Http\Dispatcher->dispatch(OCA\Notifica ... {}, "listNotifications")
/homepages/35/d120461270/htdocs/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:
OC\AppFramework\App::main("OCA\\Notifi ... r", "listNotifications", OC\AppFramew ... {}, { apiVersion ... "})
<<closure>>
OC\AppFramework\Routing\RouteActionHandler->__invoke({ apiVersion ... "})
/homepages/35/d120461270/htdocs/nextcloud/lib/private/Route/Router.php - line 297:
call_user_func(OC\AppFramew ... {}, { apiVersion ... "})
/homepages/35/d120461270/htdocs/nextcloud/ocs/v1.php - line 82:
OC\Route\Router->match("/ocsapp/app ... s")
/homepages/35/d120461270/htdocs/nextcloud/ocs/v2.php - line 24:
require_once("/homepages/ ... p")

For me it looks like the default php-command is trying to start the php cli version 4.4.9 (!!). To start the command with php version7.2 you should try to check/use the php72-command.

I know this is a basic question… but how?
I tried command with php72 occ … and php72-command, php72cli php72-cli – all came back as command not found

You always need two main php components, a web and the cli one. You have to make sure that php72 cli package is installed on your server, see:

https://packages.debian.org/search?keywords=php-cli

The debian link you shared didn’t list php7.2, just 7.0-cli and 7.3-cli
my /usr/bin/ folder has: php, php-config4.4, php-config7.1, php-config7.3, php4.4, php4.4-cli, php7.1, php7.1-cli, php7.3, php7.3-cli, along with various version 5 and 6.

So I re-ran the conversion with php7.1-cli and got a different error.

In Connection.php line 64:
                                                                                                                                                            
  Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'X@host.com' (us  
  ing password: YES)                                                                                                                                        
                                                                                                                                                            

db:convert-type [--port PORT] [--password PASSWORD] [--clear-schema] [--all-apps] [--chunk-size CHUNK-SIZE] [--] <type> <username> <hostname> <database>

That prompted me to appreciate that I had mis-entered the command - I had my password in place of the database. With that corrected I have now successfully setup my database.

Many thanks!

1 Like

BTW, you should clean-up your server and remove all legacy versions. If you have the chance to use PHP 7.3 you should use it :wink:

Unfortunately it is not my server so I have limited control.
Now that everything is working and I am on v16 I will bump to 7.3

Thanks again