Installation 9.1 without creating a new database possible?

installation
postgresql
9.1.x
help

#1

The current installation process of owncloud 9.1 creates a new database. Can that be avoided?
My trouble is: My provider won't let me create new databases. My plan includes 5 databases (Postgres or MySQL) with fixed names.

I did not find parameters to occ maintenance:install to use an existing database instead of letting the installer create a new one.

Steps to reproduce
~/www/cloud> php occ maintenance:install --database=pgsql --database-name=web207_db5 --database-user=web207_5
ownCloud is not installed - only a limited number of commands are available
What is the password to access the database with user <web207_5>?
What is the password you like to use for the admin account <admin>?
PostgreSQL username and/or password not valid
-> You need to enter either an existing account or the administrator.

The final error message gave me a hard time till I found this hint in chapter "Installation Wizard":

You will need the root database login, or any administrator login that
has permissions to create and modify databases, and then enter any name you want
for your ownCloud database.

Expected behaviour
There should a way to circumvent the creation of a new database and just use an existing one.

Server configuration
Operating system: Linux SMP Debian 3.2.73-2+deb7u2 x86_64 GNU/Linux
Web server: Apache/2.2.22 (Debian) DAV/2 SVN/1.6.17 PHP/5.6.20
Database: PostgreSQL, limited to using a predefined database
PHP version: PHP/5.6.20
ownCloud version (see ownCloud admin page): 9.1.0.3
Updated from an older ownCloud or fresh install: no.
ownCloud log: (data/owncloud.log, see https://central.owncloud.org/t/how-to-find-webserver-or-oc-logfile-enable-php-logfile/808):

{"reqId":"V5z8BiUR4EoAAHciItsAAAAB","remoteAddr":"91.60.128.152","app":"no app in context","message":"Error occurred while checking PostgreSQL version, assuming >= 9","level":2,"time":"2016-07-30T19:12:06+00:00","method":"POST","url":"\/index.php\/heartbeat","user":"--"}
{"reqId":"V5z8BiUR4EoAAHciItsAAAAB","remoteAddr":"91.60.128.152","app":"no app in context","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\DBALException\",\"Message\":\"Failed to connect to the database: An exception occured in driver: could not find driver\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/www\\\/cloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(429): OC\\\\DB\\\\Connection->connect()\\n#1 \\\/home\\\/www\\\/cloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(389): Doctrine\\\\DBAL\\\\Connection->getDatabasePlatformVersion()\\n#2 \\\/home\\\/www\\\/cloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(328): Doctrine\\\\DBAL\\\\Connection->detectDatabasePlatform()\\n#3 \\\/home\\\/www\\\/cloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(621): Doctrine\\\\DBAL\\\\Connection->getDatabasePlatform()\\n#4 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/DB\\\/Connection.php(141): Doctrine\\\\DBAL\\\\Connection->setTransactionIsolation(2)\\n#5 \\\/home\\\/www\\\/cloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DriverManager.php(172): OC\\\\DB\\\\Connection->__construct(Array, Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOPgSql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Configuration), Object(Doctrine\\\\Common\\\\EventManager))\\n#6 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/DB\\\/ConnectionFactory.php(122): Doctrine\\\\DBAL\\\\DriverManager::getConnection(Array, Object(Doctrine\\\\DBAL\\\\Configuration), Object(Doctrine\\\\Common\\\\EventManager))\\n#7 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/Server.php(410): OC\\\\DB\\\\ConnectionFactory->getConnection('pgsql', Array)\\n#8 \\\/home\\\/www\\\/cloud\\\/3rdparty\\\/pimple\\\/pimple\\\/src\\\/Pimple\\\/Container.php(113): OC\\\\Server->OC\\\\{closure}(Object(OC\\\\Server))\\n#9 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/AppFramework\\\/Utility\\\/SimpleContainer.php(102): Pimple\\\\Container->offsetGet('DatabaseConnect...')\\n#10 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/ServerContainer.php(87): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query('DatabaseConnect...')\\n#11 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/Server.php(969): OC\\\\ServerContainer->query('DatabaseConnect...')\\n#12 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/legacy\\\/db.php(56): OC\\\\Server->getDatabaseConnection()\\n#13 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/legacy\\\/db.php(133): OC_DB::prepare('SHOW SERVER_VER...', NULL, NULL)\\n#14 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/legacy\\\/util.php(880): OC_DB::executeAudited('SHOW SERVER_VER...')\\n#15 \\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/legacy\\\/util.php(860): OC_Util::checkDatabaseVersion()\\n#16 \\\/home\\\/www\\\/cloud\\\/lib\\\/base.php(587): OC_Util::checkServer(Object(OC\\\\AllConfig))\\n#17 \\\/home\\\/www\\\/cloud\\\/lib\\\/base.php(967): OC::init()\\n#18 \\\/home\\\/www\\\/cloud\\\/index.php(37): require_once('\\\/home\\\/www\\\/cloud...')\\n#19 {main}\",\"File\":\"\\\/home\\\/www\\\/cloud\\\/lib\\\/private\\\/DB\\\/Connection.php\",\"Line\":58}","level":3,"time":"2016-07-30T19:12:06+00:00","method":"POST","url":"\/index.php\/heartbeat","user":"--"}

Special configuration (external storage, external authentication, reverse proxy, server-side-encryption):

  • provider inhibits creation of new databases.

Integrity status for oC9+

not available

Install OC 9.1 and connect to an existing db
#2

What happens if you specify an existing database? If that doesn't work / is supported you can create a feature request at:

https://github.com/owncloud/core/issues


#3

I tried it. The result is written in my original request. occ says:

PostgreSQL username and/or password not valid
 -> You need to enter either an existing account or the administrator.

The username/password was correct. occ tries to "create database", this fails and results in the error mentioned.

Well, looks like a feature request, alas. I was hoping a magic idea...

Thanks for the quick answer!


#4

You don't need to use occ. Maybe the install wizard via your browser behaves different.


#5

Alas not.
Using the install wizard does the exact same thing - this time showing a german error message (meaning the same as the english message cited above): "Bad postgres username or password..."

I double checked that I can use the password to login into the database using phpMyAdmin and > CREATE tables into the existing database. It is just that CREATE DATABASE an CREATE USER are blocked, resulting in:
#1044 - Access denied for user 'web207_5'@'localhost' to database 'Mupfel'
#1227 - Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation

And I see no way to get around "CREATE DATABASE" using the current installer, even though creating a database and a user are not really essential to make ownCloud work.


#6

Ok, then i'm suggesting to go this route:


#7

Created Feature request: Allow installation using an existing database #25665

Thanks for your quick assistance here!