Bobcares

How Plesk Backup Done via Command Line?

by | Aug 10, 2024

We can create backups of the Plesk server, including all data and configurations, or only particular parts like domains, resellers, customers, and mail accounts, thanks to the powerful command-line tool Plesk backup. Let’s discuss the backup process in detail. At Bobcares, with our Plesk Support Service, we can handle your issues.

Overview
  1. Plesk Backup via Command-Line
  2. Why We Use Command-Line for Backup?
  3. Various Plesk Backup Process via Command-Line
  4. Plesk Backup Restoration via Command-Line
  5. Conclusion

Plesk Backup via Command-Line

A popular web hosting control panel with lots of features for handling domains, websites, and server setups is Plesk. The ability to make and manage backups via the command line is one of its strong points. With this feature, Plesk admins may backup all of the data and configurations on the server as well as individual components like mail accounts, domains, resellers, and customers.

It is particularly helpful when using the command line for backups if working with huge files that may be difficult to manage through the Plesk interface. We’ll explore the several choices and commands available for using the command line to perform backups in Plesk in this post.

plesk backup command line

When it comes to handling backups, Plesk’s broad command-line interface (CLI) feature set gives greater flexibility and control than using the graphical user interface (GUI). A closer look at the features of Plesk Backup CLI is the following:

1. Backup Types:

i. Full Server Backup: Backs up everything on the server, including data, configurations, and emails.

ii. Domain Backup: Backs up specific domains, including all related content and settings.

iii. Reseller and Customer Backup: Allows us to back up individual reseller or customer accounts.

2. Backup Locations:

i. Local Storage: Default backups are stored in /var/lib/psa/dumps.

ii. Remote Storage: Backups can be stored on remote FTP servers.

3. Incremental Backups:

Only saves changes since the last backup, saving space and time.

4. Scheduling Backups:

Automate backups using cron jobs to schedule them at regular intervals.

5. Compression and Encryption:

i. Compress backup files to save space.

ii. Encrypt backups to protect sensitive data.

6. Backup Filters:

Choose to back up only certain components like databases or exclude large files.

7. Restore Operations:

Restore entire servers, specific domains, or individual components using the CLI.

8. Advanced Features:

i. Retention Policies: Automatically delete old backups.

ii. Partial Restores: Restore only specific parts of a backup.

iii. Verification: Check the integrity of backup files before restoring.

Why We Use Command-Line for Backup?

In terms of the web interface, Plesk’s command line interface (CLI) is a strong tool that offers more flexibility and control over backup process. The following are some benefits of using the command line for Plesk backups:

1. Large backup files cannot be restored directly using Plesk’s interface. When backups are larger than 2 GB, the command line becomes vital.

2. With the pleskbackup tool, we can fine-tune the backup procedure by choosing which parts to backup.

3. The ease with which command line actions may be programmed makes automatic, scheduled backups possible, which is essential for maintaining regular backup schedules without the need for human involvement.

Various Plesk Backup Process via Command-Line

All backup data in Plesk is kept in the /var/lib/psa/dumps directory by default. All backup files made using the pleskbackup program are saved in this directory. Ensuring this directory has enough room to hold the backup files is crucial, particularly when working with big backups.

Entire Plesk Server Backup

To back up the entire Plesk server, including all data and configurations, we can use the following command:

/usr/local/psa/bin/pleskbackup –server -v

The -v flag is used to display detailed information about the backup process, making it easier to monitor and troubleshoot.

Single Domain Backup

We can back up a single domain, including its emails, hosting files, configuration, and database using the below code:

/usr/local/psa/bin/pleskbackup –domains-name example.com –v

We must replace example.com with the actual domain name.

Mail Configuration and Content Backup

When we only want to back up the mail configuration and content for a specific domain, we can use the following command:

/usr/local/psa/bin/pleskbackup –domains-name example.com –only-mail -v
Hosting Configuration and Content Backup

When we need to back up everything except emails, the following command will come in handy:

/usr/local/psa/bin/pleskbackup –domains-name example.com –only-hosting –v
Resellers Backup

Plesk also enables reseller account backups, an essential feature for service providers overseeing several resellers. To restore a subset of resellers, use this following command:

/usr/local/psa/bin/pleskbackup –resellers-name [Reseller1 Reseller2] –v

When dealing with numerous resellers, clients, or domains, it is more convenient to specify them in a file rather than typing them all out in the command line. Let’s see how to do it:

1. Create a file named resellers.txt containing the login names of all the resellers we want to back up, each on a new line.

/usr/local/psa/bin/pleskbackup –resellers-name –f resellers.txt –v

2. Similarly, for Clients, create a file named clients.txt with the login names of the clients:

/usr/local/psa/bin/pleskbackup –clients-name –f clients.txt –v

3. When we have a list of domains, we can use a file named domains.txt:

/usr/local/psa/bin/pleskbackup –domains-name –f domains.txt –v

Plesk Backup Restoration via Command-Line

It is helpful to restore backups via the command line, especially big ones, to prevent problems that can arise while using the Plesk interface. We can use the following command to restore a complete server backup:

/usr/local/psa/bin/pleskrestore --restore /path/to/backup/file -level server

And to restore a specific domain, we use the command:

/usr/local/psa/bin/pleskrestore --restore /path/to/backup/file -level domains -filter list:example.com

We must replace example.com with our domain name.

[Looking for a solution to another query? We are just a click away.]

Conclusion

Using Plesk backups via the command line offers an effective and adaptable method of managing and safeguarding the data on the server. The pleskbackup tool provides a variety of choices to meet the needs, whether we need to back up the entire server, certain domains, or reseller accounts. We can make sure that the backups are thorough, well-organized, and simple to restore when necessary with these steps from our Tech team.

Frequent backups are an essential component of server administration, and Plesk’s command line may help us do this chore more effectively and dependably.

2 Comments

  1. Jonson

    Nice Article

    Reply
    • Krishna Priya

      Hello,
      Thank you for your feedback! We are delighted to hear that our article was helpful to you.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF