Import an existing WordPress site
Changed onThis function imports an existing WordPress site to your cPanel account. The import runs in the background, so the function returns as soon as it queues the task.
Note:
- This function has the following prerequisites:
- The nova-wordpress entitlement.
- The redirects, wp-toolkit, wp-toolkit-site-import, and mysql features.
- Because the request carries the source WordPress credentials, use the POST method and do not place the source_password or source_user keys in the URL query string. The system rejects a request that uses another method, or that puts either key in the query string, before it reads the credentials, so they cannot leak into access logs, proxy logs, or browser history.
- The background task can still fail after this function returns, for example when a feature is revoked in the meantime. Read the outcome from the WPX::get_task_progress function.
Request
- Base URLhttps://cpanel-server.tld:2083/execute
- AuthHTTP basic
Request body application/x-www-form-urlencoded
Example request
{
"domain": "example.com",
"password_type": "application",
"source_password": "EXAMPLE-PASSWORD-PLACEHOLDER",
"source_url": "https://subdomain.example.net",
"source_user": "admin_abcd"
}Response
The HTTP request was successful.
Example response
{
"apiversion": 3,
"func": "import_website",
"module": "WPX",
"result": {
"data": {
"blocked_by": [
"system_default"
],
"domain": "example.com",
"domain_package": "ea-php73",
"domain_version": "7.3",
"domain_version_source": "domain",
"domain_version_vhost": "example.com",
"effective_version": "7.3",
"existing_installations": [
{
"id": 17,
"url": "https://example.com"
}
],
"install_id": "1784237244-988110-12345",
"required_version": "7.4",
"sse_url": "/sse/UserTasks/00000000_63d7f020927f8f/wpx_install_1784237244-988110-12345.log",
"status": "running",
"system_default_package": "ea-php73",
"system_default_version": "7.3",
"task_id": "00000000/63d7f020927f8f"
},
"metadata": {
"transformed": 1
},
"status": 1
}
}Changes
- warning
added the new
unsupported_phpenum value to the//response property for the response status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status
- warning
- info
endpoint added
- info