PiwikPRO / plugin-SiteMigration

Migrate websites and website data between two Piwik installations
17 stars 3 forks source link

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

Open nekohayo opened 8 years ago

nekohayo commented 8 years ago

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

mattab commented 8 years ago

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 :+1: feel free to issue a pull request for this change, we will be happy to merge it