Accidentally deleted config/config.ini.php, how do I rebuild it?


Automatic update failed today with the 2.0.2 version and I boneheadedly replaced the WHOLE piwik folder—config and all—with the archive from github. If I try to reinstall, it seems to want to delete my databases rather than adopt them.

How do I rebuild the config/config.ini.php?

(Matthieu Aubry) #2

first you should reinstall the version you were before using, because Piwik cannot install itself into a new version if the database is still the old format. So after reinstalling the same version, you can upgrade to 2.0 safely.


Well, I was going from 2.0.0 to 2.0.2… if I tried to install 2.0.0, would it just take on the old database without issues?

(Matthieu Aubry) #4

During the install if you specify the same prefix tables, and DB info, it will ask you to reuse or delete tables. Choose to Reuse and it should work fine! cheers


It insists on either deleting the tables or having me change the table preffix. I checked the piwik_option table, trying to find some hint as to the version I should be trying to install (in case I was mistaken initally), and it seems to think that it IS a 2.0.2 Piwik—so the auto-update crashed after it touched up the database… when I tried to jumpstart 2.0.2 earlier it also wanted to flush everything or have me re-preffix a clean install.

(Matthieu Aubry) #6

Let’s try different approach. Create a file config/config.ini.php:

; <?php exit; ?> DO NOT REMOVE THIS LINE
; file automatically generated or modified by Piwik; you can manually override the default values in global.ini.php by redefining them in this file.
host = ""
username = "root"
password= ""
dbname = "XXX"
tables_prefix = "piwik_"
adapter = "PDO\MYSQL"
charset = "utf8"

login = "root"
password = "098f6bcd4621d373cade4e832627b4f6"
email = ""
salt = "3c8f9ca0a238644809fe11b64871e8a3"

replace with your info, then you can login with root and password test


Alright, that worked!