Restore Database

I accidentally deleted one of my sites at the piwik backend system and piwik does not appear to be logging visitors anymore. The piwik folder is still located in the File Manager and I know a database still exists for the site.

How do I find out the name of the database for my site in question. I couldn’t locate it in wp-config.php

Since I have tracked this site for a while I’d like to restore prior data. Wordpress Piwik plugin shows everything is working fine, so I don’t know why I cannot access recent/historical data.

My thoughts about what to do are as follows. I’d appreciate any help if I’m missing anything.

-locate database name and backup
-Delete old folder in cpanel and delete old database
-Do a fresh install of piwik for site in question
-import backup database

So you deleted a website from Piwik Settings and want to restore it?

Create a new website with same name / URLs /etc.
Go in the database and in the table piwik_website
update the idsite field of the latest entry (the new site you just added) to be the idsite of the site you deleted.

then it should work and you can access again your data (since Piwik does not delete old data when you delete a site)

I see a few places for piwik_site, so I assume that’s the right place. I have a few follow up questions if you don’;t mind

1)Is it possible to find out what database is being used for a website? I assume it’s located somewhere in the piwik folder or root domain of a website using file manager in Cpanel.

The database used by Piwik is found in the config/config.ini.php file