Closed arechsteiner closed 7 years ago
As mentioned on the forum, I think this is expected. In Contao 3 you are unable to use the Install Tool as well, if the given database information is incorrect.
Of course it would be nice if the Install Tool still worked without a database connection as well.
This breaks the migration process described in the manual.
What exactly do you mean by that?
The installation guide describes how to move an installation using the Installtool, here:
https://docs.contao.org/books/manual/4.3/en/01-installation/moving-an-installation.html
It instructs me to 1) upload the files 2) export/import the database and finally 3) to use the Installtool to actually configure the new database connection.
Step number 3 is impossible if the Installtool requires an already working MySQL connection.
Indeed. Since that part of the manual is taken from Contao 3, it should probably be fixed in Contao 3 as well.
I've tried manually updating parameters.yml before, however that did not work.
The error in the log file still shows the old credentials. I've found this forum post instructing me to use php app/console cache:clear --env=prod
to clear the cache, but the .zip version of Contao doesn't include any folder or file called 'app/console' and I get the error Could not open input file: app/console
What are the correct steps to adjust parameters.yml on a remote host to configure a new MySQL database?
After changing the parameters.yml
you need to clear the cache.
In the managed-edition
you can do that via
php vendor/bin/contao-console cache:clear
or use the Contao Manager.
In the standard-edition
you can do that via
php bin/console cache:clear
Or simply delete the folder var/cache/prod
manually.
Correct me if I'm wrong but I think the .zip version does not include this php bin/console cache:clear
command at all. In my local installation there is no bin folder and the command returns Could not open input file: bin/console
.
Deleting the folder manually did the trick
Correct me if I'm wrong but I think the .zip version does not include this php bin/console cache:clear command at all.
Read my post again ;). bin/console
is for the standard-edition
(or any Symfony standard application). Since you are talking about the ".zip version" you are refering to the managed-edition
.
Ah. I did not realize that the .zip version was also know as the managed-edition. Thanks it all works now.
I still think this should be fixed either in the documentation or in the install tool itself.
I still think this should be fixed either in the documentation or in the install tool itself.
Agreed.
I don't think we can fix this in the install tool, because the only possible fix is to purge the Symfony cache as soon as the install tool is opened. However, we are only purging the cache after the install tool password has been entered to prevent random people from deleting your cache by simply opening the install tool (which is not a protected route).
So I guess we should update the manual, shouldn't we @contao/developers?
But couldn't a fallback be implemented, when the database connection is not valid? Similar to https://github.com/contao/core-bundle/pull/889
@leofeyer: I'm not too familiar with the Contao code base but there has to be a better way than this, no?
What about a two step process? If the MySQL connection fails after logging in to the install tool, display a prompt "MySQL connection failed, would you like to reconfigure your MySQL settings?". If the user clicks yes, then reset parameters.yml and reconfigure those settings. Or do that automatically (which is what I expected originally).
Is that not technically possible?
I feel like this is such a common use case that it should be handled via the user interface if possible to increase the user experience.
Does the issue still occur in Contao 4.4.1?
Nope, as far as I tested it, it is fixed now :)
🎉
I ran into trouble when trying to move a minimal Contao 4.4.0 "Hello World" website that I created through the .zip file (manual installation) to a remote host. The install tool under (contao/install) would throw an error related to MySQL, which makes little sense because obviously I need to use that very tool in order to fix the MySQL connection and point it to the new database.
The problem can be reproduced locally by creating a simple website (with website root and article) and turning off the MySQL server. The install tool then fails with this error:
This breaks the migration process described in the manual.
Forum Thread (in German): https://community.contao.org/de/showthread.php?67128-Contao-Install-Tool-scheitert-ohne-MySQL-Verbindung&p=443236#post443236