Skip to content

Register now for our Web Enablement Ecosystem webinar!

  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Solutions
    By Role
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    By Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    By Cloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    Partner Program
    Exclusive discounts, benefits and exposure to take your business to the next level
    Become a partner
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    Explore Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    Key Topics
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    Feature Packs
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    Featured Extension
    SocialBee
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • Extension
  • Pricing
  • Extensions
  • Help Center
  • More
    • Careers
    • Events
    • Plesk University
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • 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

Industry
Partners

industry-partner_ALIBABA
industry-partner_GOOGLEPARTNER
industry-partner_MICROSOFT
industry-partner_REDHAT-r2
industry-partner_ALIBABA
industry-partner_AUTOMATTIC
industry-partner_AWS
industry-partner_DIGITALOCEAN
industry-partner_SCALEWAY
Follow us:
Facebook Twitter Linkedin Youtube Github

COMPANY

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY

Blog
Forums 
Plesk University

First defaul

Company

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE​

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS​

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY​

Blog
Forums
Plesk University

Follow us:
Facebook Twitter Linkedin Youtube Github

© 2025 WebPros International GmbH. All rights reserved. Plesk and the Plesk logo are trademarks of WebPros International GmbH.

Managed with love with Plesk WP Toolkit