Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Cryptic error message when --db-prefix is not specified (should be a mandatory argument/question?) #16

Open
nekohayo opened this issue Sep 7, 2015 · 1 comment

Comments

@nekohayo
Copy link

nekohayo commented Sep 7, 2015

Hi there!

It took me a while to figure out what I had done "wrong" here:

$ ./console migration:site 11   
Please provide the destination database host [localhost]: 
Please provide the destination database username: foobar_piwik
Please provide the destination database password: 
Please provide the destination database name: foobar_piwik-alternate
INFO [2015-09-07 02:33:59] Start transaction
INFO [2015-09-07 02:33:59] Migrating site config

  [Zend_Db_Statement_Exception]                                                                           
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'foobar_piwik-alternate.site' doesn't exist

  [PDOException]                                                                                          
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'foobar_piwik-alternate.site' doesn't exist

The error messages you see there are a bit cryptic. Eventually I figured it out:

$ ./console migration:site 11 --db-prefix="piwik_"
Please provide the destination database host [localhost]: 
Please provide the destination database username: foobar_piwik
Please provide the destination database password: 
Please provide the destination database name: foobar_piwik-alternate
INFO [2015-09-07 02:36:19] Start transaction
INFO [2015-09-07 02:36:19] Migrating site config
INFO [2015-09-07 02:36:19] Loading existing actions
INFO [2015-09-07 02:36:19] Migrating log data - visits
INFO [2015-09-07 02:36:21] Migrating log data - link visit action
INFO [2015-09-07 02:36:23] Migrating log data - conversions and conversion items
INFO [2015-09-07 02:36:23] Migrating archive data
INFO [2015-09-07 02:36:56] Commit transaction

I think the SiteMigration plugin could be a little bit smarter, by

  • Clarifying the error message you see further below (it says "Base table or view not found […]"; it could be clearer on the fact that the problem might be the missing db table prefix?), if possible.
  • In interactive mode, prompting the user for the table prefix (and prefilling it with the default "piwik_" value?) so that it's fool-proof.
@mattab
Copy link
Contributor

mattab commented Sep 8, 2015

Hi @nekohayo

Thanks for the report. Definitely we should ask for database table prefix just like we ask for host, username, password and db name 👍 feel free to issue a pull request for this change, we will be happy to merge it

@mattab mattab added this to the Current sprint milestone Oct 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants