Child pages
  • UAPI Functions - WordPressBackup::start
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Description

This function starts a single WordPress® site backup.

Note:

You must install the WordPress Manager cPanel plugin to access this API function.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/WordPressBackup/start?site=example.com


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Start the WordPress site backup.
 $instances = $cpanel->uapi(
    'WordPressBackup', 'start',
	array(	
		'site' => 'example.com'
	)
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Start the WordPress site backup.
my $instances = $cpliveapi->uapi(
    'WordPressBackup', 'start',
	{
		'site' => 'example.com'
	}
);


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- Start the WordPress site backup. -->
[% data = execute( 'WordPressBackup', 'start', { 'site' => 'example.com' } ); %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username WordPressBackup start site=example.com


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
	"data": {
		"sse_url": "/sse/WordPressBackup",
		"site": "example.com",
		"backup_id": "example.com__2018-10-10T10:53:31-0500"
	},
	"status": 1,
	"errors": null,
	"metadata": {},
	"warnings": null,
	"messages": null
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
sitestring

Required

The WordPress site's URL.

A URL without the protocol prefix.

example.com
example.com/wordpress

Returns

ReturnTypeDescriptionPossible valuesExample
sitestringThe WordPress site's URL.A URL without the protocol prefix.example.com
backup_idstringThe unique ID of the backup process.A valid string.

example.com__2018-10-10T10:53:31-0500

sse_url

stringThe SSE path that the system uses to monitor the backup progress.The path to the SSE service, without the protocol, hostname, or port./sse/WordPressBackup
  • No labels