• 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!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.

Question Event Manager - Create DB when domain created

D

Deleted member 190513

Guest
Hello,

I'm trying to automate the creation of a database whenever a domain is created, but I cannot seam to get it to work. I'm missing the part where I fetch the subscriber for which the new domain is created.
.
I'm running this line:
plesk bin database -c ${NEW_DOMAIN_NAME} -domain ${HOW-TO-GET-SUBSCRIBER} -type mysql -server localhost

As you can see, I don't know how to get the subscriber. I've been looking at every article I can get my hands on. How do I do this?
 
Hello,
You don't need domain subscriber for this command actually as -domain parameter expects domain name to be specified. So for creating database try running:
Code:
plesk bin database -c 'db_name' -domain ${NEW_DOMAIN_NAME} -type mysql -server localhost
 
Hello,
You don't need domain subscriber for this command actually as -domain parameter expects domain name to be specified. So for creating database try running:
Code:
plesk bin database -c 'db_name' -domain ${NEW_DOMAIN_NAME} -type mysql -server localhost

Thank you for the suggestion, but I've already tried that - and it doesn't seam to work. See the images below.

2019-05-23 09-48-11.png err2.png
 
Sorry, this example will work for Default domain (the first domain added to a subscription) created event only.
For additional domains you will have to retrieve default domain (webspace) name, for example using API: you can get webspace ID first and then webspace name.
 
Back
Top