1. Home
  2. Linux

How To Backup KDE Plasma 5 Desktop Settings On Linux

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

Back Up KDE Connect

Instead, it’s better to sort through and copy out all the KDE items. Let’s start by backing up one of the KDE Plasma desktop’s key features: KDE Connect. Keeping a backup of KDE connect really helps, as it’s a pain to re-set everything up.

Start out by using CD to move into ~/.config

cd ~/.config

Copy the KDE connect folder into a new Plasma backup folder.

mkdir ~/plasma-backups

cp -R kdeconnect

Alternatively, feel free to create a separate archive of it:

tar -jcvf kdeconnect-backup.tar.bz2 kdeconnect

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

mkdir plasmak-backups

cp k* plasmak-backups

mv plasmak-backups ~/plasma-backups

The majority of the files have been backed up. Keep in mind that you may have more items, so use the ls command and look around for any other widget folders you may want to save. Move them with the mv command into ~/plasma-backups.

Back Up KDE Plasma

Now that a lot of the non-plasma KDE-related files are safely copied into the ~/plasma-backups folder, we can move the core Plasma backup items to the backup folder created earlier.

mv plasma* ~/plasma-backups

Everything pertaining to the KDE Plasma desktop environment should be inside of ~/plasma-backups. At last, we can create the tar archive backup of everything. Start off by moving the terminal out of ~/.config and into the home folder.

cd ~/

Then, use the tar command to create a new archive backup.

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

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

Restoring The Backup

Need to restore the backup to a new install? Get started by downloading your plasma-backups.tar.bz2 archive file. Move it from the folder you downloaded it to and put it in ~/.config/ For example:

cd ~/Downloads

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

From here, you’ll be able to extract the archive backup contents.

tar -xvf plasma-backups.tar.bz2

cd plasma-backups mv * ..

rmdir plasma-backups

rm plasma-backups.tar.bz2

Everything should go exactly where it needs to.

When the restoration is complete, log out of your KDE session, and then back in. Everything should be like it was when you created the backups!

Automated KDE Plasma 5 backups – Deja-Dup

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

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

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

Add all folders that don’t pertain to KDE Plasma 5. Excluding these files should dramatically cut the size of your backup archive.

Note: Deja Dup currently doesn’t support filtering of each file, so some other non-KDE files may be included in the backup, depending on what is installed.

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

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

Go to “Overview” in the Deja Dup backup tool and click “Backup” to create the first backup. From now on, all KDE Plasma desktop settings will back up automatically.

Restoring The Backup

Restoring backups for KDE Plasma on Deja Dup is pretty easy and it starts by opening up Deja Dup and clicking on “storage location”. In the location box, fill out the network details correctly so Deja Dup can find everything.

With the correct location set, click on “Overview” and then select the “Restore” button. If Deja Dup correctly finds the storage location, the restoration can begin. When Deja Dup finishes, restart your PC. As you log in, everything should be back to normal.

Leave a comment