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.

acc termination doesn't drop databases

Discussion in 'cPanel Developers' started by bmett, Dec 13, 2010.

  1. bmett

    bmett Well-Known Member

    Joined:
    Aug 5, 2010
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brisbane, AU
    Hi there,

    We recently moved servers and since then terminating an account (via cPanel or via API) doesn't drop the two databases of the account anymore.

    When creating a website I use postwwwact to create these two databases, but use a local script on a different account to create the tables (I would like to leave it this way, different reasons for that).

    They only thing I can think of is that we now use suPHP as PHP handler and therefore the user that creates the tables inside these databases isn't nobody anymore.

    But why doesn't the termination process drop the databases? Isn't the termination running as root and therefore shouldn't care about permissions?

    Thanks for any help.

    Cheers,
    Bjorn
     
  2. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    I am guessing that you are creating the databases manually and not using the cpanel api. With 11.28, the databases need to be mapped to the account. It is not enough to just create them using the prefix of the username.
     
  3. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Bjorn,

    My first hunch is similar to sirdopes. But I know that you and I have had conversations in previous threads about utilizing the API methods, so I'm less inclined to believe that this in your exact problem.

    If you are using the APIs for creation/deletion, then you may have another issue that warrants further investigation. Please feel free to open a support ticket and reference this forum post. Our technicians can help isolate the problem and escalate the issue as necessary. If you do decide to open a ticket, please PM me the ticket number so that I can assist the technicians accordingly.

    Best Regards,
    -DavidN
     
  4. bmett

    bmett Well-Known Member

    Joined:
    Aug 5, 2010
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brisbane, AU
    Hi David,
    Hi sirdopes,

    Thank you for the replies.

    @sirdopes: I do create the tables in the databases manually. The databases are created via the postwwwacct script. On the old server the issue didn't come up and we used an up-to-date cPanel Version (11.28) on that server. Same version we use right now on the new server.

    @David: I do use the API to create and to delete (terminate) the accounts. An interesting thing is that if I create an account manually via WHM, a following termination does drop the two databases created by the postwwwacct script. In this case though no tables were created inside these database. Thats why I have the suspicion that the existent of tables inside the database stop the termination process to drop the databases.

    Our 'standard' procedure is to create the account via the API and than let a custom script (not the postwwwacct script) create the needed tables after the creation has been done. This script runs is a PHP script running on an existing account on the server. Thats why I mentioned the PHP handler on the new server.

    I will open a ticket now and send you the ticket no via PM.

    Thanks again for your help guys,

    Cheers,
    Bjorn
     
  5. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Bjorn,

    I got the ticket number and will be following it closely. In the meantime, I'd suggest reading this article I wrote:
    Frequently Asked Scripts: "How do I automate XYZ after creating an account?" - cPanel Integration

    It was written when I was testing cPanel 11.25.1, so DB Mapping was still considered experimental. That said, I can't completely vouch for all the paragraph content, but the code examples should still work seamlessly, since they're all using the APIs!

    The idea of the article is to use the XML-API PHP client class to make cPanel API calls, all from a postwwwacct script. Though, with some tweaking, you should be able to do it from your custom script all you need to do is include the xmlapi.php class file and away you go!

    Concerning the drop/no drop based on tables/content: I'm trying to wrap my head around why the WHM/cPanel code would behave that way. I can't think of a valid reason; I'll have to keep pondering it. Rest assured, if you use the API for the db creation, it will get removed when you terminate the account, regardless.

    If we come up with anything that might help the community, then we can post it here, otherwise the specifics of your issues will probably be communicated via your ticket. Always feel free to PM me if you need anything.

    Best Regards,
    -DavidN
     
  6. bmett

    bmett Well-Known Member

    Joined:
    Aug 5, 2010
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brisbane, AU
    Hi David,

    Thanks again for the reply. I've been in contact with Keith from the technical support and he has been a great help. To make it short, bottom line is I'll have to use the API to create the database in my postwwwacct script. Shouldn't be a big deal, especially not with the links and code samples you and Keith provided.

    Once again I have to say 'thumbs up!' to the cPanel Support staff. Every time I use this forum or even create a support ticket I'm amazed how quick an thorough you guys respond. You guys doing an awesome job.

    Thanks again,
    Bjorn
     
Loading...

Share This Page