Followup of #1951068: install.php error reporting is broken
When Drupal is already installed, and someone tries to run install.php, it outputs list of suggestions.
This list doesn't contain description of how to re-install Drupal, using existing settings.php.
The closest item is

To start over, you must empty your existing database, delete your active configuration, and copy default.settings.php over settings.php

This item should be changed to explain that it is possible to use existing settings.php (removing active configuration variables)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

Category: bug » task
Issue tags: +Novice
mgifford’s picture

This would be good.

rteijeiro’s picture

I managed to reinstall following this steps:

- Deleted the drupal8 database.
- Deleted all the files and directories in /sites/default/files
- And changed the settings.php file permissions to 775.
- Run the install.php again and run.

Are this steps valid?

I can create the patch if you agree with this solution.

valthebald’s picture

#3: maybe that depends on environment, I also had to remove all mentions of active configuration from settings.php

rteijeiro’s picture

So valthebald, it is almost the same that override the settings.php with a new copy from default.settings.php, isn't it?

valthebald’s picture

not exactly.
default.settings.php does not contain connection string to your database, existing settings.php does

xjm’s picture

For this screen, we should keep the text simple. See #1951068: install.php error reporting is broken #67 and #68.

rteijeiro’s picture

I agree with xjm, but the second point relates to install to a different database so I guess it's better to place that in the first point that relates to start over.

jenlampton’s picture

Title: Clearly state how to re-install Drupal using existing settings.php » Restore the ability to install Drupal using an existing settings.php file

In Durpal 7 when there was already a settings.php file and you ran the installer, it would simply skip the step where it asked you for db credentials. I'd love to get d8 to this same point so we don't have any regression.

This may mean we need to locate the settings variables that were changed on the initial install and overwrite them with the values for the new install, but I don't see why we can't do that.

Let's not solve this problem with more documentation, let's actually solve the problem please :)

xjm’s picture

Issue tags: -Novice

#9 is actually a very sane course of action, though we would have to decide what to do about a config directory where the active or staging directories were not empty. Maybe list it as one of the things to fix on the checklist dealy?

pwolanin’s picture

Category: task » bug

I think this is a bug/regression. It's pretty important not to have to write the settings.php out in some cases.

jhodgdon’s picture

Category: bug » task

+1000 on #9. That you can't do this in d8 is a regression IMO. Saves a bunch of time.

See also
#2083733: Add instructions for reinstall to INSTALL.txt

The current situation is really not helpful. I mean if I do everything I"m supposed to (clean out db, clean out sites/default/files) but forget to make a new blank settings.php copied from default.settings.php, I get that not-at-all helpful message. What if I'm on a plane and don't have internet access?

pwolanin’s picture

Category: task » bug

this is a bug.

sun’s picture

Hm. The original purpose of this issue (on-screen help) was changed to a different purpose in #9 (fixing re-installation with existing settings.php).

When I encountered the currently existing bug/regression, I noticed this existing issue, but only read the summary and first comments, and thus concluded that it has a different purpose.

I'm currently working on a fix for the bug referenced in #9 over in #2155701: Installer starts with fatal error/exception "table 'semaphore' not found" if settings.php contains $databases already

In turn, it appears to make sense to revert this issue to its original purpose, but leaving that decision to you guys. :)

jhodgdon’s picture

Title: Restore the ability to install Drupal using an existing settings.php file » Make sure install.php gives accurate information if Drupal is already installed
Issue summary: View changes
Status: Active » Postponed

Well, let's postpone this one until that other one is finished then. Meanwhile, changing title again.

sun’s picture

Status: Postponed » Active
moshe weitzman’s picture

Also, you don't have to 'delete your active configuration' anymore as thats in the DB.

valthebald’s picture

Issue tags: +Novice
fnuppy’s picture

Assigned: Unassigned » fnuppy
Status: Active » Needs review
Issue tags: +dcdn-sprint
FileSize
1.29 KB

First attempt.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for the patch! However:

-<li>To start over, you must empty your existing database, delete your active configuration, and copy <em>default.settings.php</em> over <em>settings.php</em>.</li>
+<li>To start over, you need to remove active configuration variables in existing settings.php file ($config_directories). Otherwise you must empty your existing database, delete your active configuration, and copy <em>default.settings.php</em> over <em>settings.php</em>.</li>

This actually doesn't make sense to me -- from this text, I do not know what I really need to do or how to do it.

And see #17 - since config is usually stored in the database now, you probably do not need to remove it in most cases.

amitgoyal’s picture

Status: Needs work » Needs review
FileSize
1.54 KB
1.55 KB

Looks like original text is good enough and we just need to remove "delete your active configuration" as per #17.

Please review.

mgifford’s picture

Why did you introduce this change?

-      '@base-url' => $GLOBALS['base_url'],
+      '!base-url' => $GLOBALS['base_url'],
jhodgdon’s picture

mgifford: @key inside t() or format_string() means "run this through check_plain()". URLs should not be run through check_plain, they should be inserted as-is, which is why ! is more appropriate.

jhodgdon’s picture

Status: Needs review » Needs work

After this patch, the instructions are still talking about finding the active configuration in the bullet list.

Also:

<li>To install to a different database, edit the appropriate <em>settings.php</em> file in the <em>sites</em> folder.</li>

What does this mean actually? What is it trying to accomplish, since the previous instruction told them to copy default.settings.php anyway? I am not sure you can install with the database information already filled in in settings.php at all.

Also... Can someone please try those instructions and see if they are sufficient to allow reinstalling, or if more things need to be deleted?

mgifford’s picture

@jhodgdon - thanks. I just had noticed it wasn't in the previous patch and didn't think the thread mentioned that it had been added to the latest patch.

amitgoyal’s picture

Status: Needs work » Needs review
FileSize
1.54 KB
980 bytes

Looks like we don't really need those extra lines. Please review updated patch.

I have successfully tried re-installing Drupal 8 by emptying my database and by copying default.settings.php to settings.php.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

I think this looks good! I'll mark it RTBC and we can see if anyone else disagrees with its accuracy or wording (probably best not to commit it for a few days until people have had a chance to comment).

BiigNiick’s picture

i tested the patch #26 on the latest release. works very well.

-nick

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2983bfe and pushed to 8.x. Thanks!

  • Commit 2983bfe on 8.x by alexpott:
    Issue #1963760 by amitgoyal, fnuppy | valthebald: Fixed Make sure...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.