Migrate SQLite to MySQL on Webhosting

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 (20.0.4):
Operating system and version (Linux a2e37 4.9.0-12-amd64 #1 SMP Debian 4.9.210-1+deb9u1 (2020-06-07) x86_64):
Apache or nginx version (not sure):
PHP version (7.3):

The issue you are facing:
I get the following error when trying to run
php console.php db:add-missing-indices
inside my nextcould folder (this is a webhosting by netcup and i only got a chrooted account)

An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file in /nextcloud.domain.com/lib/private/DB/Connection.php:72
Stack trace:
#0 /nextcloud.domain.com/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1449): OC\DB\Connection->connect()
#1 /nextcloud.domain.com/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(892): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /nextcloud.domain.com/lib/private/DB/Connection.php(202): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM "...', Array, Array, NULL)
#3 /nextcloud.domain.com/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM "...', Array, Array)
#4 /nextcloud.domain.com/lib/private/DB/QueryBuilder/QueryBuilder.php(217): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /nextcloud.domain.com/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /nextcloud.domain.com/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /nextcloud.domain.com/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /nextcloud.domain.com/lib/private/legacy/OC_App.php(949): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /nextcloud.domain.com/lib/private/Server.php(668): OC_App::getAppVersions()
#10 /nextcloud.domain.com/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#11 /nextcloud.domain.com/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#12 /nextcloud.domain.com/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#13 /nextcloud.domain.com/lib/private/ServerContainer.php(156): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', true)
#14 /nextcloud.domain.com/lib/private/Server.php(1677): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 /nextcloud.domain.com/lib/private/Server.php(1017): OC\Server->getMemCacheFactory()
#16 /nextcloud.domain.com/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#17 /nextcloud.domain.com/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#18 /nextcloud.domain.com/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#19 /nextcloud.domain.com/lib/private/ServerContainer.php(156): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', true)
#20 /nextcloud.domain.com/lib/private/Server.php(1977): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#21 /nextcloud.domain.com/lib/private/Files/View.php(118): OC\Server->getLockingProvider()
#22 /nextcloud.domain.com/lib/private/Server.php(395): OC\Files\View->__construct()
#23 /nextcloud.domain.com/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#24 /nextcloud.domain.com/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#25 /nextcloud.domain.com/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#26 /nextcloud.domain.com/lib/private/ServerContainer.php(156): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', true)
#27 /nextcloud.domain.com/lib/private/Server.php(1324): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#28 /nextcloud.domain.com/lib/base.php(595): OC\Server->boot()
#29 /nextcloud.domain.com/lib/base.php(1091): OC::init()
#30 /nextcloud.domain.com/console.php(49): require_once('/nextcloud.lang...')
#31 {main}bash-4.4$

I get the same error when trying to convert the database from SQLite to MySql with this command:

php occ db:convert-type --all-apps --clear-schema --no-interaction --password="dataBasePasswort" databaseUser databaseIP:3306 database

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

Steps to replicate it:

  1. Install nextcloud on webhosting
  2. try to run php console.php db:add-missing-indices in nextcloud installation folder with chrooted

The output of your Nextcloud log in Admin > Logging:

No Log entry

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

<?php
$CONFIG = array (
  'instanceid' => 'xxxxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.domain.com',
  ),
  'datadirectory' => '/var/www/vhosts/hostingxxxxxx.xxxxx.netcup.net/nextcloud.domain.com/data',
  'dbtype' => 'sqlite3',
  'version' => '20.0.4.0',
  'overwrite.cli.url' => 'http://nextcloud.domain.com',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'no-reply',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_domain' => 'domain.com',
  'mail_smtpport' => '25',
  'mail_smtpname' => 'no-reply@domain.com',
  'mail_smtppassword' => 'mailPassword',
  'mail_smtphost' => 'mail.server.com',
);

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

No permission to see

please use the occ command to do this.

1 Like

Hello rakekniven,
if i try this command i get this message:

bash: occ: command not found

The occ file got the following permissions:

-rwxr-xr-x 1 hostingxxxxxx psacln 283 Dec 21 13:26 occ

Cheers,
Patrick

Please read the docs. See

Hello rakekniven,

i am not sure how to run occ as the http user (i can’t use sudo because i don’t got the permissions on my webhosting)

Cheers,
Patrick

Please ask your hoster “how can I run a command as webserver user?”

I did, they told me that there is no option to do that in the webhosting package.

Sad but true: Change your hoster. See https://nextcloud.com/signup/ or any other you like.

1 Like