Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mattab opened this issue Feb 5, 2014 · 9 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Feb 5, 2014

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".

@tsteur
Copy link
Member

tsteur commented Feb 7, 2014

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)

@mattab
Copy link
Member Author

mattab commented Feb 8, 2014

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

@tsteur
Copy link
Member

tsteur commented Feb 9, 2014

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

@tsteur
Copy link
Member

tsteur commented Feb 9, 2014

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

@tsteur
Copy link
Member

tsteur commented Feb 9, 2014

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.

@tsteur
Copy link
Member

tsteur commented Feb 9, 2014

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

@tsteur
Copy link
Member

tsteur commented Feb 9, 2014

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

@tsteur
Copy link
Member

tsteur commented Feb 10, 2014

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

@tsteur
Copy link
Member

tsteur commented Feb 10, 2014

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

@mattab mattab added this to the 2.1 - Piwik 2.1 milestone Jul 8, 2014
@tsteur tsteur modified the milestones: 2.4.0 - Piwik 2.4.0, 2.1 - Piwik 2.1 Jul 11, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…tallation 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)
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…cy, make sure the remove the install_in_progress key after successful installation
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…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.
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants