Getting information from the Plesk (PSA) database

Previously have used a number of SQL commands to check the Plesk database as some times Plesk doesn’t quite work as it should, or, needed to get information manually.

The following URL had a number of typical task SQL queries for the psa database:

Some of the commands (incase the remote site goes down in the future) are below:

Email account details

mysql> SELECT CONCAT(mail.mail_name,’@’,domains.name) AS Email_Address , accounts.password AS Password FROM mail, domains, accounts WHERE domains.id=mail.dom_id AND mail.account_id=accounts.id;

Database user details

mysql> SELECT domains.name, data_bases.name, data_bases.type , db_users.login,accounts.password FROM domains, data_bases, db_users, accounts WHERE domains.id=data_bases.dom_id AND data_bases.id=db_users.db_id AND db_users.account_id=accounts.id;

FTP/System user details

mysql> SELECT domains.name, sys_users.login, accounts.password, sys_users.home, sys_users.shell, sys_users.quota FROM domains, accounts, hosting, sys_users WHERE domains.id=hosting.dom_id AND hosting.sys_user_id=sys_users.id AND sys_users.account_id=accounts.id;

IP Address details

mysql> SELECT domains.name, IP_Addresses.ip_address, IP_Addresses.mask, IP_Addresses.iface, IP_Addresses.type FROM domains, IP_Addresses, hosting WHERE domains.id=hosting.dom_id AND hosting.ip_address_id=IP_Addresses.id;

Client details

Single:

mysql> SELECT clients.pname AS Client_Name, clients.cname AS Company_Name, clients.email, clients.login, accounts.password FROM clients, accounts WHERE pname=”CLIENT_NAME” AND clients.account_id=accounts.id;

All:

mysql> SELECT clients.pname AS Client_Name, clients.cname AS Company_Name, clients.email, clients.login, accounts.password FROM clients, accounts WHERE clients.account_id=accounts.id;

The site Praveen’s Matrix appears to have a number of other great articles regarding Plesk, MySQL etc.

Upgrading Windows Plesk 8.1.1 to 8.6

Upgrading from Windows Parallels Plesk 8.1.1 to 8.6 went smoothly according to the installer, however, after the upgrade completed and machine rebooted the Plesk control panel no longer loaded.

It would often return an error to the browser, but, also occasionally would say:

get_config_string failed: PRODUCT_DATA_D: The system cannot find the file specified. (Error code 2) at Unable to connect to pipe \\.\pipe\psapipe

Tried running the Plesk reconfigure tool to fix the problem, however, it didn’t help.  Contacted Parallels Plesk support and they started looking into it after some time.

It turns out that….

I am working on this issue currently. I’ve found out that Plesk database was not upgraded to appropriate version at all. It is still from 8.1.0 version:

C:\Program Files\SWsoft\Plesk\admin\bin>dbclient.exe –direct-sql –sql=”select * from upgrade_history”
upgrade_date    version_info    db_version
2007-02-16 00:00:00     8.1.0   7.5.6

As there is not automatic toll for upgrading database I am upgrading it manually. It will take some prolonged time. Please, wait, I will keep you updated with any news.