• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Finding domain named from ID number using command line

Will TCSI

New Pleskian
I have a domain that was deleted through plesk but it has left behind confs ... ran a command to show the domain id , and showed up as per below..

My question is ,.. is there a command line i can run that pulls up of the domain name associated with this ID to be 100% sure before i run its delete command.?

I have found a command that pulls ID from domain name..( which didnt work for this domain as its in error...but worked for all others i tried) -- i just need one that does the reverse!
So i am 99% sure I have the right ID.. just want to be 100% sure !

Thanks All

[root@vps0 ~]# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa -e "select c.id, c.objectId as 'domain_id' from Configurations c left join domains d on c.objectId=d.id where c.obje
ctType in ('domain', 'nginxDomain') and d.id is null"
+-----+-----------+
| id | domain_id |
+-----+-----------+
| 346 | 70 |
 
I don't understand what you are seeking. Something like this
SELECT id FROM domains WHERE name LIKE 'domainname' LIMIT 1;
or
SELECT name FROM domains WHERE id LIKE 'id' LIMIT 1;
?
 
Last edited:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e 'select id from domains where name="domain.tld";'
yields the ID linked with the domain name queried,

however When I use # mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e 'select id from domains where name="localchimes.com";'
It yields no answer as that domain is the faulty one ( which i am 99% sure will match ID70)

I was just seeing if there was a command the exact " reverse" process of the above where i can put in a query on the id instead , to see if it yields an associated domain name.
many thnaks
 
hi..
I am far from a mysql expert.. hence why i use plesk,, so I dont need to know mysql CLI queries....hence my struggling

i tried
[root@vps0 ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e 'select domainname from domains where id="70";'
ERROR 1054 (42S22) at line 1: Unknown column 'domainname' in 'field list'

could you help with correct syntax perhaps?
Sorry to be a pain..
 
I am sorry, I made a mistake. The field name is "name", not "domainname". So correct query is:
SELECT name FROM domains WHERE id LIKE '70' LIMIT 1;
 
thanks so much.. i put in
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e 'select name from domains where id="70";'
and saimply returned a blank line
so i am assuming i can wipe ID70 without worrying about accidentally wiping a live clients domain out
 
Did you run
# plesk repair db
before? Because a missing dataset in domains table does not necessarily mean that there are not references in other tables pointing to that set. If repair db does not show any warnings, things ought to be alright.
 
yes had run that before..

bit the bullet and tried deleting

[root@vps0 ~]# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa -e "delete from Configurations where id in (70)"
[root@vps0 ~]# /usr/sbin/apachectl -t
Warning: DocumentRoot [/var/www/vhosts/localchimes.com.au/httpdocs] does not exist

gah back to square one...

looks like ill have to open a support ticket with plesk direct
thanks so much for all your help...
cheers will
 
You should not remove anything from configurations table. The "id" of a dataset of configurations table is not linked with the id of a dataset in the domains table. Further, after removing data from the Plesk DB, even if it is done correctly, you'd still need to run httpdmng --reconfigure-all to create the web server configurations.

I think, too, that letting support solve it is a good idea.
 
Back
Top