.pdf)
WHM Plugins
Whostmgr::Transfers module. The module is dynamically loaded. You may not see proper XML output if you have altered this module so that it does not conform to WHM's new mechanism for capturing output using the Cpanel::Demultiplexer module.
restoreaccount function from within your custom script:
/xml-api/restoreaccount function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/xml-api/restoreaccount
restoreaccount function from within your custom script:
/json-api/restoreaccount function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/json-api/restoreaccount
restoreaccount function takes the following variables as input.
The following variables are required: 1.
monthly — Using this value in the type parameter causes the function to restore the user's most recent monthly backup.
weekly — Using this value in the type parameter causes the function to restore the user's most recent weekly backup.
daily — Using this value in the type parameter causes the function to restore the user's most recent daily backup.
1 will create and restore the account. Setting this parameter to 1 will cause the function to fail if the account already exists. Setting this value to 0 will restore the account without attempting to create the account.
1 allows you to restore the account's access to a dedicated IP address. This variable is only used if all is set to 1.
1 allows you to restore the acount-level vfilters (filters) and valiases (forwarders).
1 allows you to restore the account's SQL databases.
1 allows you to restore the account's subdomain entries.
0 — Indicates that the function failed.
1 — Indicates that the function completed successfully.
https://example.com:2087/xml-api/restoreaccount?api.version=1=&user=user&type=1 in WebHost Manager will produce output similar to:
<result>
<metadata>
<result>1</result>
<reason>OK</reason>
<version>1</version>
<command>restoreaccount</command>
<output>
<raw>
Extracting tarball...................
Done<br />
Extracting Domain....Done<br />
Done<br />
<br /><br />Restoring cpanel user config fileDone<br />
<br />Restoring reseller privs (if any)<br />Restoring Locale Setting<br />Restoring SSL keys and CertificatesDone<br />
<br />Restoring frontpage (if installed)Done<br />
<br />Restoring access logs.... Done<br />
<br /><br />Restoring domain keys.... Done<br />
<br /><br />Restoring DB MAP File.... Done<br />
<br /><br /><span class="b2">Restoring PostgreSQL databases....</span>
Restoring PostgreSQL privs<!-- --> Done<br />
<br />Restoring Mailman listsDone<br />
<br />Restoring Mailman ArchivesDone<br />
<br />Restoring shell<blockquote><pre>Current shell /bin/bash is up to date.
</pre></blockquote>Done<br />
<br />Restoring password<blockquote><pre></pre></blockquote>Done<br />
<br />Restoring proftpd fileDone<br />
<br />Resyncing FTP Passwords<blockquote><pre>Updating ftp passwords for userFtp password files updated.Ftp vhost passwords synced</pre></blockquote>Done<br />
<br />Linking old home directories<br />Parsing Domain Databases...ParkedDomains......AddonDomains...<br />Restoring Domains<br />
<br />Restoring Bandwidth DataDone
<br />Restoring Counter Data<pre></pre><br />Restoring Homedir....<blockquote><pre></pre></blockquote>Done<br />
<br />Doing fileprotect conversion<br />Restoring nobody owned filesDone<br />
<br />Restoring Mail filesDone<br />
<br />Restoring userdata.... Done<br />
<br /><br />Restoring custom virtualhost templates.... Converting email to cPanel 5+ (if needed)<blockquote><pre></pre></blockquote>Done<br />
<br />Cleaning up filters (if needed)<blockquote><pre>vfilter converter v3.0Updating vfilter files to latest format.Running for user only (force=0) (has_spam_acl=1)Processing user......Done</pre></blockquote>Done<br />
<br />Fixing mail permissions<blockquote><pre></pre></blockquote>Done<br />
<br />Restoring crontabDone<br />
Converting to maildir if needed<blockquote><pre></pre></blockquote>Done<br />
Restoring Dns Zones<blockquote><pre>Restoring zone: user.com.db
</pre></blockquote><br />Adding missing subdomain DNS entries (if needed)<pre></pre><br />Update Proxy subomains<blockquote><pre>Adding proxy subdomains for domain example.com.Records Installed</pre></blockquote>Done<br />
<br />Updating SPF Records<blockquote><pre></pre></blockquote>Done<br />
<br />Restoring quota<blockquote><pre></pre></blockquote>Done<br />
<br /><br />Update mail routing<blockquote><pre>LOCAL MAIL EXCHANGER: This server will serve as a primary mail exchanger for example.com's mail.: This configuration has been manually selected.
</pre></blockquote>Done<br />
<br />Rebuilding Apache Conf<br />Restore CompleteAccount Restore Complete
Unlocking password for user user.passwd: Success.<br />
</raw>
</output>
</metadata>
</result>
https://example.com:2087/json-api/restoreaccount?api.version=1=&user=user&type=1 in WebHost Manager will produce output similar to:
{
"metadata":{
"result":1,
"reason":"OK",
"version":1,
"command":"restoreaccount",
"output":{
"raw":"Extracting tarball...................\nDone<br />\nExtracting Domain....Done<br />\nDone<br />\n<br /><br />Restoring cpanel user config fileDone<br />\n<br />Restoring reseller privs (if any)<br />Restoring Locale Setting<br />Restoring SSL keys and CertificatesDone<br />\n<br />Restoring frontpage (if installed)Done<br />\n<br />Restoring access logs....\nDone<br />\n<br /><br />Restoring domain keys....\nDone<br />\n<br /><br />Restoring DB MAP File....\nDone<br />\n<br /><br /><span class=\"b2\">Restoring PostgreSQL databases....</span>\nRestoring PostgreSQL privs<!--\n-->\nDone<br />\n<br />Restoring Mailman listsDone<br />\n<br />Restoring Mailman ArchivesDone<br />\n<br />Restoring shell<blockquote><pre>Current shell /bin/bash is up to date.\n</pre></blockquote>Done<br />\n<br />Restoring password<blockquote><pre></pre></blockquote>Done<br />\n<br />Restoring proftpd fileDone<br />\n<br />Resyncing FTP Passwords<blockquote><pre>Updating ftp passwords for userFtp password files updated.Ftp vhost passwords synced</pre></blockquote>Done<br />\n<br />Linking old home directories<br />Parsing Domain Databases...ParkedDomains......AddonDomains...<br />Restoring Domains<br />\n<br />Restoring Bandwidth DataDone\n<br />Restoring Counter Data<pre></pre><br />Restoring Homedir....<blockquote><pre></pre></blockquote>Done<br />\n<br />Doing fileprotect conversion<br />Restoring nobody owned filesDone<br />\n<br />Restoring Mail filesDone<br />\n<br />Restoring userdata....\nDone<br />\n<br /><br />Restoring custom virtualhost templates....\nConverting email to cPanel 5+ (if needed)<blockquote><pre></pre></blockquote>Done<br />\n<br />Cleaning up filters (if needed)<blockquote><pre>vfilter converter v3.0Updating vfilter files to latest format.Running for user only (force=0) (has_spam_acl=1)Processing user......Done</pre></blockquote>Done<br />\n<br />Fixing mail permissions<blockquote><pre></pre></blockquote>Done<br />\n<br />Restoring crontabDone<br />\nConverting to maildir if needed<blockquote><pre></pre></blockquote>Done<br />\nRestoring Dns Zones<blockquote><pre>Restoring zone: user.com.db\n</pre></blockquote><br />Adding missing subdomain DNS entries (if needed)<pre></pre><br />Update Proxy subomains<blockquote><pre>Adding proxy subdomains for domain example.com.Records Installed</pre></blockquote>Done<br />\n<br />Updating SPF Records<blockquote><pre></pre></blockquote>Done<br />\n<br />Restoring quota<blockquote><pre></pre></blockquote>Done<br />\n<br /><br />Update mail routing<blockquote><pre>LOCAL MAIL EXCHANGER: This server will serve as a primary mail exchanger for example.com's mail.: This configuration has been manually selected.\n</pre></blockquote>Done<br />\n<br />Rebuilding Apache Conf<br />Restore CompleteAccount Restore Complete\nUnlocking password for user user.passwd: Success.<br />"
}
}
}