Articles in this section

Local backup structure in Plesk for Linux

kb: how-to Plesk for Linux kb: auxiliary

Applicable to:

  • Plesk for Linux

Question

What is the structure of the local backups in Plesk for Linux?

Answer

The Plesk backup storage is specified by the DUMP_D variable defined in the /etc/psa/psa.conf configuration file. The default location is /var/lib/psa/dumps.

  • Each backup consists of:

    1. <info>.xml - file which contains settings of the server/reseller/customer/subscription, etc.
    2. <backup>.<tar|tgz|tzst> - archived backup files which include website content, databases, etc.
    3. The directory .discovered, which contains the technical information of the backup.
  • The backup objects hierarchy is as follows:

    Warning: Modifying Plesk backup structure is not recommended.

    1. Root backup directory where server backups, daily dumps, subdirectories with backups of resellers, clients, and domains, etc. are stored:

      CONFIG_TEXT: /var/lib/psa/dumps/
      /var/lib/psa/dumps/.discovered

    2. Subdirectory domains/ where backups of domains owned by the Plesk admin and objects owned by the domains are stored:

      CONFIG_TEXT: /var/lib/psa/dumps/domains
      /var/lib/psa/dumps/domains/<domain.name>
      /var/lib/psa/dumps/domains/<domain.name>/.discovered
      /var/lib/psa/dumps/domains/<domain.name>/databases/
      /var/lib/psa/dumps/domains/<domain.name>/sites/<domain.name>

    3. Subdirectory clients/ where Customer objects owned by admin and objects owned by the Customer accounts are stored:

      CONFIG_TEXT: /var/lib/psa/dumps/clients
      /var/lib/psa/dumps/clients/<client.login>
      /var/lib/psa/dumps/clients/<client.login>/.discovered
      /var/lib/psa/dumps/clients/<client.login>/domains/<client.domain>/
      /var/lib/psa/dumps/clients/<client.login>/domains/<client.domain>/.discovered
      /var/lib/psa/dumps/clients/<client.login>/domains/<client.domain>/sites/<domain.name>

      Directories are identified by the Customer's login and the domain name.

    4. Subdirectory resellers/ where backups of resellers, their clients, domains and other objects owned by Resellers and Resellers' clients are stored:

      CONFIG_TEXT: /var/lib/psa/dumps/resellers
      /var/lib/psa/dumps/resellers/<reseller.login>
      /var/lib/psa/dumps/resellers/<reseller.login>/.discovered
      /var/lib/psa/dumps/resellers/<reseller.login>/domains/<reseller.domain>
      /var/lib/psa/dumps/resellers/<reseller.login>/domains/<reseller.domain>/.discovered
      /var/lib/psa/dumps/resellers/<reseller.login>/domains/<reseller.domain>/databases
      /var/lib/psa/dumps/resellers/<reseller.login>/clients/<client.login>/.discovered
      /var/lib/psa/dumps/resellers/<reseller.login>/clients/<client.login>/domains/<client.domain>
      /var/lib/psa/dumps/resellers/<reseller.login>/clients/<client.login>/domains/<client.domain>/databases
      /var/lib/psa/dumps/resellers/<reseller.login>/clients/<client.login>/domains/<client.domain>/.discovered

    5. The repositories are identified by reseller login, reseller's domain name, customer login and customer's domain name.

  • To distinguish files belonging to different backups of the same object, a specific prefix and suffix are added to the file names:

    • The backup is added by default.

    • A suffix designating the backup creation date is always added to each backup file, and the date format is <yymmddhhmm>.

      Note: For example, the files of a backup created on 29 May 2021, 03:08 PM will have the suffix name: 2105291508, for example: backup_info_2105291508.

The list of all files included in the backup can be found via the command find:

For example, to find all the files for backup created on 29 May 2021, 03:08 PM:

# find $(awk '$1=="DUMP_D"{print$2}' /etc/psa/psa.conf) -name '2105291508'
/var/lib/psa/dumps/clients/jdoe/domains/example.com/backup_logs_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/backup_info_2105291508.xml
/var/lib/psa/dumps/clients/jdoe/domains/example.com/backup_conf_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/sites/sub.example.com/backup_logs_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/sites/sub.example.com/backup_conf_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/sites/sub.example.com/backup_pd_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/sites/sub.example.com/backup_statistics_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/backup_pd_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/.discovered/backup_info_2105291508
/var/lib/psa/dumps/clients/jdoe/domains/example.com/backup_apache-files_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/backup_statistics_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/backup_domainmail_2105291508.tgz
/var/lib/psa/dumps/clients/jdoe/domains/example.com/backup_user-data_2105291508.tgz

From the output above it is seen that this is a backup of a subscription example.com which includes the domain example.com  and the subdomain sub.example.com. This subscription belongs to the customer with the login jdoe. The client belongs to Plesk administrator.

Technical details of a Plesk backup stored in the .discovered directory are:

# ls -la /var/lib/psa/dumps/clients/jdoe/domains/example.com/.discovered/backup_info_2105291508/
total 56
drwxr-xr-x 2 root root 4096 May 29:15 .
drwxr-xr-x 6 root root 4096 May 29 15:08 ..
-rw-r--r-- 1 root root 20 May 29 15:08 cid_apache-files
-rw-r--r-- 1 root root 562 May 29 15:08 cid_domainmail_25
-rw-r--r-- 1 root root 408 May 29 15:08 cid_user-data
-rw-r--r-- 1 root root 113 May 29 15:08 dumpresult_SUCCESS
-rw-r--r-- 1 root root 86 May 29 15:08 object_index
-rw-r--r-- 1 root root 17204 May 29 15:08 profile.log
-rw-r--r-- 1 root root 139 May 29 15:08 props
-rw-r--r-- 1 root root 0 May 29 15:08 status_OK
-rw-r--r-- 1 root root 5 May 29 15:08 storages

Where:

  • cid_apache-files - index of webspace files which are accessed explicitly for users apache or www-data.

  • cid_domainmail_25 - index of files with mail messages.

  • cid_user-data - index of webspace files.

  • object_index - index of objects included in the backup (resellers, customers, subscriptions, domains, mailboxes, etc.).

    Note: The index of webspaces/files is used to determine which files should be included in the next incremental backup and from which archive the files should be extracted during restoration.

  • dumpresult_SUCCESS:

    • dumpresult_SUCCESS. Indicates that the backup was created without issues.
    • dumpresult_WARNINGS. Provides the list of warnings that appeared during the backup creation.
    • dumpresult_ERROR. Provides the list of errors that appeared during the backup creation.
  • profile.log - telemetry data.

  • props - contains backup properties.

  • storages - contains the list of repositories where the backup was created. For example, local/ftp, etc.

  • status_OK - indicates the backup status:

    • status_OK. Indicates a valid backup.
    • status_WRONG-FORMAT. Indicates that the *.xml backup file is invalid.
    • status_CONTENT-ERROR. Indicates that the part of tar archives is missing.
    • status_SIGN-ERROR. For a modified backup in which the backup signature does not match the backup content.
      The following notification is shown in Plesk when clicking on the backup: Warning: This backup was created on another server or modified after creation.

    Note: The backup status file is kind of like a cache. You need to remove it to allow Plesk Backup Manager to generate a new status file.


In the Plesk GUI, backups can be checked in:

  • Tools & Settings > Backup Manager:

    1.png

  • Domains > example.com > Backup & Restore:

    2.png

  • For Reseller/Customer in their panel in Tools & Utilities > Backup Manager or in Domains > example.com > Backup & Restore.

The content of the auxiliary subdirectory .discovered is not visible in Plesk. Foreign files located in the backup directories are also not visible in Plesk UI.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.