Categories
Ξ TREND

How to Backup KDE Plasma 5 Desktop Settings on Linux

Love Plasma 5 and want to back up your configuration files just in case? If so, you’ll need to do some digging in your home directory, as the configuration files for the KDE Plasma 5 desktop belong in the ~/.config/ folder. That being said, KDE does not save all of its settings in one folder. Instead, they are scattered all over the place in the ~/.config folder. It is possible to back up KDE Plasma 5 by saving the entire configuration folder, but this is not something we recommend. The hidden configuration area in most Linux distributions is large. Compressing it would take too long.

KDE Connect Backup

Instead, it’s better to classify and copy all KDE items. Let’s start by backing up one of the key features of the KDE Plasma desktop: KDE Connect. Keeping a backup of KDE Connect really helps, as it’s a hassle to set everything up again.

Start by using CD to move to ~/.config

cd ~/.config

Copy the KDE connection folder to a new Plasma backup folder.

mkdir ~/plasma-backups cp -R kdeconnect

Alternatively, feel free to create a separate file of the same:

tar -jcvf kdeconnect-backup.tar.bz2 kdeconnect

Next, review and create a backup of all files related to “k”. This will include things like “kwin” and “kscreenlocker” etc.

mkdir plasmak-backups cp k* plasmak-backups mv plasmak-backups ~/plasma-backups

Most of the files have been backed up. Note that you can have more items, so use the ls command and browse to any other widget folder you want to save. Move them with the mv command to ~/plasma-backups.

KDE Plasma Backup

Now that many of plasma’s non-KDE related files have been safely backed up to the ~/plasma-backups folder, we can move the main Plasma backup items to the backup folder created earlier.

mv plasma* ~/plasma-backups

Everything related to the KDE Plasma desktop environment should be inside ~/plasma-backups. At last, we can create the tar file backup of everything. Start by moving the terminal from ~/.config to the home folder.

cd ~/

Then use the tar command to create a new backup of the file.

tar -jcvf plasma-backups plasma-backups.tar.bz2

Each file inside the ~/plasma-backups folder is now compressed into one archive. Feel free to take this folder and upload it to Dropbox, Google Drive, home servers, etc.

Restoring the backup

Do you need to restore the backup to a new installation? Begin by downloading your plasma-backups.tar.bz2 archive file. Move it out of the folder where you downloaded it and place it in ~/.config/ For example:

cd ~/Downloads mv plasma-backups.tar.bz2 ~/.config/

From here, you will be able to extract the contents of the file backup.

tar -xvf plasma-backups.tar.bz2 cd plasma-backups mv * .. rmdir plasma-backups rm plasma-backups.tar.bz2

Everything should go exactly where it is needed.

When the restore is complete, log out of KDE and then log back in. Everything should be like when you created the backups!

KDE Plasma 5 Automated Backups – Deja-Dup

There are many ways to create file backups on Linux, but Deja Dup is one of the best. If you are an avid KDE Plasma 5 user and want to keep track of your KDE Plasma configuration files at all times, you might want to consider using Deja Dup for backups.

The advantage of going this route is that Deja Dup can back up via multiple interfaces such as local network shares (Samba, FTP), directly to various online storage sites, or even locally. Another advantage of using Deja Dup is that it is possible to tell the backup tool what to exclude.

Here’s how to set up an automated backup of your KDE Plasma settings. First, follow the installation process in our guide here. Then, open Deja Dup and select “folders to ignore”. Click the + sign and navigate to the ~/.config folder.

Add any folders that do not belong to KDE Plasma 5. Excluding these files should drastically reduce the size of your backup file.

Note: Deja Dup currently does not support file-by-file filtering, so some other non-KDE files may be backed up, depending on what is installed.

Then go back to the main page and select “Save Folders”. Click + and add ~/.config as the main backup folder.

Now that the correct folders are ready to go, click on “Schedule” and click the slider next to “automatic backup”.

Go to “Overview” in the Deja Dup backup tool and click “Backup” to create your first backup. From now on, all KDE Plasma desktop configurations will be done automatically.

Restoring the backup

Restoring backups for KDE Plasma in Deja Dup is quite easy and starts with opening Deja Dup and clicking “storage location”. In the location box, fill in the network details correctly so Deja Dup can find everything.

With the correct location set, click on “Summary” and then select the “Restore” button. If Deja Dup successfully finds the storage location, the restore can begin. When Deja Dup finishes, restart your PC. Upon login, everything should be back to normal.

By Daniel Wright

With over 25 years of experience as an operating system developer, I have dedicated my career to mastering the intricacies of various operating systems. My journey with Linux began in 1999, and since 2015, it has become my everyday operating system of choice. Sharing my knowledge and passion for technology, I also serve as a teacher at The Game Assembly, nurturing the next generation of talented developers. With a focus on DDoS security, I strive to protect systems and networks from malicious attacks, ensuring a secure and stable online environment.