mainechap

Registered
Feb 27, 2015
1
0
1
cPanel Access Level
Root Administrator
I've seen the API1/adddb and API2/createdb functions for creating new databases. What about cloning an existing database? E.g. I have a model database that I want to be able to clone for new customers. Is there a way to do that programmatically via the API? (I'm using PHP in case it makes any difference.) Thanks for any help or suggestions!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Hello :)

We don't offer any API functions that allow you to clone or copy an existing database, but you are welcome to submit a feature request for this via:

Submit A Feature Request

In the meantime, you could develop a script that copies/clones the database through the MySQL command line and have it run as a post account creation script hook:

Guide To Standardized Hooks

Thank you.