Need help?

Our experts have had an average response time of 12.14 minutes in September 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Duplicity restore full backup – How to install and perform

by | Feb 7, 2021

Recently we came across a support request regarding Duplicity restore full backup as a part of our Server Management Services.

Duplicity is a common application to generate backups. A full account restoration would be necessary to recover and to get the business going again after an unpredicted catastrophic event.

Today, let us discuss in detail Duplicity and how our Support Engineers perform restorations with Duplicity.


What is Duplicity?

Let’s start with a basic understanding of Duplicity. We can use it to generate digitally signed, encrypted incremental backups. It works well with Unix like operating systems.

Duplicity backups can be stored locally as well as in remote locations like S3, SFTP, and WebDAV. Deja-dup is the graphical user interface for Duplicity in Ubuntu.


Installation of Duplicity Backup

We can install Duplicity easily using the following command in the terminal window:

sudo apt-get install duplicity

Sometimes we need the NcFTP package to use the Duplicity FTP backup. To install the same, we run:

sudo apt-get install ncftp

In addition, we need to create the backup directory at the remote server.

mkdir -p /remote_backup_directory

Generally, our Support Engineers uses SFTP to transfer the Duplicity backups to remote locations.

SSH keys need to be set up with both the servers to perform a password-less transfer.

To set up an extra layer of security, we can use GPG. To generate the key, we run:

gpg –gen-key

It will ask for a few details like the type of key, name, email address, and optionally, a comment associate with this key. It also asks for a passphrase, which we should set to ensure proper encryption.

Once the key is generated, it displays the public key on the screen. We can also retrieve it by using the command:

gpg –list-keys


Duplicity full backup setup

The syntax to generate backup using gpg is as follows:

PASSPHRASE=”passphrase_we_set_for_GPG” duplicity –encrypt-key public_key –exclude /proc –exclude /sys –exclude /tmp / sftp://[email protected]//remote_backup_directory

Once this is done the backup folder in the remote server will fill with the backups as shown below:

Duplicity restore full backup

The script below may help if we prefer a full server backup with no encryption via rsync.

Duplicity restore full backup

The above command by default generates incremental backups. To make it generate a full backup of the server, we can use the option full with it.

duplicity full –no-encryption –exclude /mnt –exclude /tmp –exclude /proc –exclude /sys / rsync://[email protected]//<backup-directory>

Then to run these backup tasks periodically, a cron job can be set at the source server end. We can use either of the options to remove older backups from the remote backup host:

remove-all-but-n-full count: Delete all backups sets that are older than the count. If the count is 2, it retains only 2 recent backups and deletes all others.

remove-older-than time: Delete all backup sets older than the given time. Old backup sets will not delete if backup sets newer than time depend on them


Duplicity restore full backup

Restoration from the Duplicity backup is easy. We just need to interchange the remote and local parameters. A restore with backup can perform using the command below:

PASSPHRASE=”passphrase_we_set_for_GPG” duplicity sftp://[email protected]//path_of the_backup

To restore a single file using duplicity, we can go for the command below:

PASSPHRASE=”passphrase_we_set_for_GPG” duplicity –file-to-restore /path/to/file sftp://[email protected]//path_of_the_backupfile /path/to/restore/file

By default, the files already present in the server won’t be restored. Alternatively, for the restoration to complete successfully, either delete the file prior to running the script or use a different path or file name.

[Couldn’t finish the backup? We’d be happy to assist you]



In short, Duplicity is an efficient backup application. Today we discussed simplified steps to configure Duplicity backup and how our Support Engineers perform a Duplicity-restore full backup.


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

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.


var google_conversion_label = "owonCMyG5nEQ0aD71QM";


Submit a Comment

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

Privacy Preference Center


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]


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


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

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie


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.