Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Installation: when upgrading from 2.0.3 and reusing existing tables during install, sql error #4631

Closed
mattab opened this Issue · 9 comments

2 participants

Matthieu Aubry Thomas Steur
Matthieu Aubry
Owner

This ticket goal is to fix the installer in the use case of reinstalling over the same DB and reusing Piwik tables, as to not lose any data.

Use case:

  • Currently running Piwik 2.0.3
  • Delete config file
  • Upload latest Piwik 2.0.4
  • Go through install and set the same DB as before.
  • Click "Reuse existing tables"
  • Next step create a super user. Click the button, and we get the error: There was an error when adding the Super User:
  • SQLSTATE[42S22]: Column not found: 1054 Unknown column 'superuser_access' in 'field list'

The reason is that the DB is still in version 2.0.3 and so the new column added in 2.0.4-b3 is not yet in the DB.

Solution:

As soon as "reuse tables" during the installation, we should run the Updater process (in the background), and report any error that may have occured during the update, as part of the installation process. If it was successful, maybe we write the message "The database was successfully updated from 2.0 to 2.0.4!"

Maybe in this case we could rename step 5 from "Creating the Tables" to "Reusing the Tables".

Thomas Steur
Owner

In d0e5faa: refs #4631 started to work on installing updates during installation in case we reuse existing tables. Problem: In case there are updates available and one of those updates writes a config the installer thinks we are already done. Therefore we do now create the config file as early as possible and before the install the updates. We create the config file once we have the database information. Also allows us to remove the db_infos session hack. While installation is in progress we set a flag in General currently named install_in_progress (tbd)

Matthieu Aubry
Owner

Nice approach to fixing this!

Feedback:

  • When I type in an existing DB + table prefix, I don't get option to reuse tables. Instead it displays the message in red: Error: it seems you tried to skip a step of the Installation process, or your cookies are disabled, or the Piwik configuration file was already created. Make sure your cookies are enabled and go back to the first page of the installation .
    • After this, I go back to first step, click Next twice, and it skips step 3 Database Setup to directly go to Step 5 creating tables.
    • Expected: the red message is not displayed and instead the Step 4 / 5 are loaded directly.
  • When reusing tables, maybe the Super User should also be reused and the step to create Super user be skipped? Otherwise I was trying to create another Super user called "root" and got the error " There was an error when adding the Super User: - Login 'root' already exists. "
    • This would be similar to how 'Setup a Website' and 'Javascript tracking code' are skipped
    • Maybe still we could be nice to the user and tell him what the current Super User login is, in case he forgot the username. if he wants to change the password he can do it after the installer.
  • Selecting "About Piwik translations" in the language selector brings the red error message
Thomas Steur
Owner

In e2d3362: refs #4631 it is now possible to update from 1.0 to 2.0.4 during installation

Thomas Steur
Owner

In 5409ade: refs #4631 added translation and success icon for consistency, make sure the remove the install_in_progress key after successful installation

Thomas Steur
Owner

In 3698d41: refs #4631 do no longer reuse existing db info if they are already present during installation. This was not working before and removed it again after it is not that easy and not really doable with the current installer.

Thomas Steur
Owner

In 3ccf74d: refs #4631 tweaking the output in case of an error during the update

Thomas Steur
Owner

In e996f03: refs #4631 update menu title as long as we are on the reuse table page

Thomas Steur
Owner

In 5bb441b: refs #4631 updates key whether translation is in progress

Thomas Steur
Owner

Done and should work. I've tested loads of different possibilities. Hope did not miss a special use case...

Matthieu Aubry mattab added this to the 2.1 - Piwik 2.1 milestone
Thomas Steur tsteur was assigned by mattab
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4631 started to work on installing updates during installation …
…in case we reuse existing tables. Problem: In case there are updates available and one of those updates writes a config the installer thinks we are already done. Therefore we do now create the config file as early as possible and before the install the updates. We create the config file once we have the database information. Also allows us to remove the db_infos session hack. While installation is in progress we set a flag in General currently named install_in_progress (tbd)
d0e5faa
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4631 it is now possible to update from 1.0 to 2.0.4 during inst…
…allation
e2d3362
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4631 added translation and success icon for consistency, make s…
…ure the remove the install_in_progress key after successful installation
5409ade
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4631 do no longer reuse existing db info if they are already pr…
…esent during installation. This was not working before and removed it again after it is not that easy and not really doable with the current installer.
3698d41
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.