The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Clone database via API?

Discussion in 'cPanel Developers' started by mainechap, Feb 27, 2015.

  1. mainechap

    mainechap Registered

    Joined:
    Feb 27, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    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!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page