Page tree
Skip to end of metadata
Go to start of metadata

For cPanel & WHM version 60

Overview 

You can use the /usr/local/cpanel/scripts/pkgacct script to create a cpmove archive for an account. After you create the cpmove archive, you can transfer the account between servers.

The /usr/local/cpanel/scripts/pkgacct script

To use this script, run the following command as the root user:

/usr/local/cpanel/scripts/pkgacct [arguments] username destination

Notes:

  • In this example, username represents the username of the cPanel account for which to create a cpmove  archive. 
    • Pass this value after any arguments and before the destination path.
    • You cannot back up the root user.
  • In this example, desintation represents the path to the directory in which you wish to store thecpmove archive. 
    • This value is optional
    • You must pass this value after the username.
  • The /usr/local/cpanel/scripts/pkgacct script does not use the cpbackup-exclude.conf file to exclude files or directories from backups.

Arguments

The /usr/local/cpanel/scripts/pkgacct script accepts the following arguments:

ArgumentDescription
--allow-override

Use the /var/cpanel/lib/Whostmgr/Pkgacct/pkgacct file to package the account, if it exists.

Note:

Pass this argument before any other arguments (in the 0th position).

--mysql=X.X

Specify the version of MySQL® that the account's databases use.

For more information, read the How to use the --mysql, --roundcube, and --dbbackup arguments section below.

--roundcube=X.X

Specify the version of Roundcube that the account uses.

For more information, read the How to use the --mysql, --roundcube, and --dbbackup arguments section below.

--dbbackup=all|schema|name

Specify the database backup type to perform.

  • all — The script backs up all of the database information. (This is the default option.)
  • schema — The script only backs up the database schemas. (You should only use this option if you back up your databases through a different method, but you wish to track a database's users.)
  • name — The script only backs up the database names. (MySQL databases will transfer as placeholders that contain a CREATE TABLE command, while PostgreSQL® transfer as empty .tar placeholder files.)

For more information, read the How to use the --mysql, --roundcube, and --dbbackup arguments section below.

--get_versionDisplay the version of the pkgacct script.
--use_backups

Use the account's last known successful backup as a template when the script creates the cpmove archive. This option may speed up the backup process.

--incremental

Update the destination file with any new content since the previous backup. and remove any content that no longer exists on the account.

If the destination file does not exist, the script creates a new file in that location.

Note:

This argument automatically declares the --nocompress argument in order to create an uncompressed archive.

--split

Create the cpmove archive in chunks. This argument reduces the overall load on the system.

--nocompress

Do not compress the cpmove archive.

--compress

Override the --nocompress argument, if it exists. 

Note:

The /scripts/pkgacct script compresses archives by default.

--userbackup Allow the user to use the cpmove archive as a backup for the account.
--backup

Use the cpmove archive as a backup for the account.

Notes:

  • If you pass this argument, you must pass a destination.
  • This argument creates the username.tar.gz file, where username represents the account's username.
--skipacctdb

Exclude the account's databases from the cpmove archive.

Note:

This argument is an alias for the --skipmysqldb and --skippgsqldb arguments.

--skipauthlinksExclude the user's external authentication credentials from the archive.
--skipbwdataExclude the account's bandwidth data from the archive.
--skipdnszonesExclude the account's DNS zone file information from the archive.
--skipdomainsExclude the account's subdomains, parked domains (aliases), and addon domains from the archive.
--skipftpusersExclude the account's FTP user accounts from the archive.
--skiphomedir

Exclude the user's home directory from the archive.

Note:

Use this argument if you will save or transfer the home directory with another method, such as the rsync command.

--skipintegrationlinksExclude the account's integration links from the archive.
--skiplocaleExclude the account's locale information or customized locale from the archive.
--skiplogsExclude the account's log files from the archive.
--skipmailconfigExclude the account's mail configuration information from the archive.
--skipmailmanExclude the account's Mailman mailing lists from the archive.
--skipmysql

Exclude the account's MySQL databases, database users, and database grants from the archive.

Note:

If you pass the --skipacctdb argument, the --skippgsql argument becomes redundant.

--skippasswdExclude the user's password from the archive.
--skippgsql

Exclude the account's PostgreSQL databases, database users, and database grants from the archive.

Note:

If you pass this the --skipacctdb argument, the --skippgsql argument becomes redundant.

--skipquotaExclude the account's disk quota limits from the archive.
--skipresellerconfigExclude the account's reseller privileges from the archive.
--skipshellExclude the account's shell information and privileges from the archive.
--skipsslExclude SSL certificates and files that the server's Apache configuration contains. It does not exclude SSL files that the user's home directory contains.
--skipuserdataExclude the account's subuser information.
--serialized_outputEncode each line of the script's output in JSON format in order to allow the live_tail_log.cgi script to stream it.
--helpDisplay a brief help message.
--manDisplay the script's full documentation.

How to use the --mysql, --roundcube, and --dbbackup arguments

To use the /usr/local/cpanel/scripts/pkgacct script's --mysql, --roundcube, and --dbbackup arguments, enter a space or an equals sign (=) between the argument and the value that you wish to pass to it.

For example, to specify MySQL version 5.5.11, run the following command:

/usr/local/cpanel/scripts/pkgacct --mysql=5.5.11 username

Additional information