• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

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