Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

Working with Custom Backup Storages

 
backup and restore extension dataextensions guideplesk features available for extensionsbackupbackup manager

Plesk provides the option of choosing a remote storage to keep your
backups, such as an FTP server. Using Plesk SDK, it is also possible to
add more different custom backup storages, and enable Plesk to use them
to keep the backups.

Class
pm_Hook_Backup_Transport
defines a set of methods, which describe the necessary functions of
authentication and authorization, working with files, etc. With the help
of this hook, Plesk Backup Manager knows about the new custom storage,
and provides all the same operations and information that are available
for the default backup storages.

To illustrate the subject, the following sample project is provided by
Plesk: https://github.com/plesk/ext-cloud-backup-example.

Authorization

As the extension developer, you may choose to handle authorization,
using either OAuth2 or login and password.

Login and Password

The login and password (or access key/secret key) used for
authentication with the custom storage are specified on the custom
storage settings sub-form,
pm_Hook_Backup_Transport::getSettingsSubForm(),
along with other settings. The entered login and password must be
validated in the
pm_Form_SubForm::isValid()
method.

OAuth2

OAuth2 authorization must be implemented in the
pm_Hook_Backup_Transport::authorize()
method. This method is always called before displaying the custom
storage settings sub-form,
pm_Hook_Backup_Transport::getSettingsSubForm().

Verification

Method
pm_Hook_Backup_Transport::check()
should be used to make sure all the functions involved in backup and
restore operations (e.g., CRUD) are available. This method is called
before each backup operation.

Remarks

  1. Make sure to use the Plesk Key-Value Storage to
    encrypt and safely store passwords and access tokens.
  2. Create separate directories in the custom storage root directory for
    the different objects to keep their backup files from mixing.

Working with Files

Writing to Custom Storage

The methods responsible for writing the created backup to the custom
storage are called in the following order:

  1. openFileWrite()
  2. [multiple calls]
    appendFile()
  3. closeFile()

Some storages may require the size of the file written to be known
before starting the file upload. This information is not available
during the Plesk backup creation. In this case, the backup should be
split into a set of files of a known size. The files should be named in
the following manner:

  1. backup.tar
  2. backup.tar1
  3. backup.tar2
  4. ...

This way, Plesk Backup Manager will be able to correctly display
information and work with the backup.

Reading from Custom Storage

The methods responsible for reading the backup from the custom storage
are called in the following order:

  1. openFileRead()
  2. [multiple calls]
    readFile()
  3. closeFile()

Testing Your Extension with Custom Storage

To make sure all the backup/restore-related extension functions work
properly, run the following command:

/opt/psa/admin/bin/pmm-ras --check-repository --debug --verbose --dump-storage=ext://<ext name>/subscription/<id>/ --session-path=/var/log/plesk/PMM
Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

You Are Always Safe When You Have an Up-To-Date Plesk Backup

Read More »

All You Need to Know About the Plesk WP Toolkit 4.10 Release

Read More »

Backup Importance, Its Types And Strategies

Read More »
Knowledge Base

Testing Interaction with External Services

Read More »

Downloading Backup Files from Server

Read More »

Uploading Backup Files to Server

Read More »

Removing Backup Files from Server

Read More »

Hosting Wiki

  • GIT
  • Server Redundancy
  • Vertical Cloud
  • Cloud Management
  • Cloud Service Architecture
  • Cloud Computing
  • Amazon CloudFront
  • Google Cloud CDN
  • Cloudflare
  • GitHub
  • Bare Metal Server
  • Backup
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Plesk
  • Web Server
  • DNS Server
  • Cloud Hosting
  • HTTP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family