Alternative to "/scripts/postrestoreacct" (event after account transfer from other server)
So here is where I found information pertaining to my use case/this script.
I've read that /scripts/postrestoreacct is deprecated, and from that same page:
This hook method is deprecated. To convert script hooks to use the Standardized Hooks system, use System or Whostmgr events in your Hook Action Code.
On both the System and Whostmgr "functions" pages, I see no events that replicate this functionality of triggering custom code once the files from a transferred account have finished migrating. What I'm trying to do: Create a "Standardized Hook" that listens for an event that signifies that the files pertaining to a cPanel account that has been transferred from another server have successfully been copied. I want to then modify the contents of one of the files included in some sub-directory. I've been searching for about a week and I have yet to find anything that can point me in the right direction to implement this functionality(other than the deprecated "/scripts/postrestoreacct".) If anybody has any ideas, they would be much appreciated!
On both the System and Whostmgr "functions" pages, I see no events that replicate this functionality of triggering custom code once the files from a transferred account have finished migrating. What I'm trying to do: Create a "Standardized Hook" that listens for an event that signifies that the files pertaining to a cPanel account that has been transferred from another server have successfully been copied. I want to then modify the contents of one of the files included in some sub-directory. I've been searching for about a week and I have yet to find anything that can point me in the right direction to implement this functionality(other than the deprecated "/scripts/postrestoreacct".) If anybody has any ideas, they would be much appreciated!
-
Hey Michael! This hook does in fact need to be exclusive to accounts that are transferred. What I'm intending to do is replace hardcoded database credentials on an incoming account(website). The process would ideally look like this: - ]
- Initiate cPanel account transfer
- Fire "Accounts::Create" event + my custom "Standardized Hook" that creates a database + user and assigns permissions of that database to that user(this is done)
- Detect when the files for the account have arrived, and programmatically swap out the hardcoded database name, database user, and database user password
0 -
Hello, We recently published a document on transferring accounts via WHM API 1 at: WHM API 1 Functions - get_transfer_session_state - Software Development Kit - cPanel Documentation However, there are likely a few different alternatives to that idea, depending on how you prefer to develop the script. Thank you. 0
Please sign in to leave a comment.
Comments
3 comments