1. Home
  2. Linux
  3. Back up the mate desktop settings linux

How To Back Up The Mate Desktop Settings On Linux

If you’re new to Linux and the Mate desktop environment and looking to create a quick backup of your settings and desktop, you’ll be interested to know that it’s easier than you think. Follow along with the guide below and learn how to use Dconf and the terminal to correctly backup your Mate desktop settings.

SPOILER ALERT: Scroll down and watch the video tutorial at the end of this article.

Install Dconf

Backing up the Mate desktop settings is possible thanks to Dconf. It’s a database system that many Gnome-like desktop environments rely on to define things on the desktop environment for the user.

On many Linux installations, the Dconf tools we need are already there. However,  if you’re missing the Dconf tools (for whatever reason), it’s best to follow the instructions below and learn how to re-install them.

Ubuntu

sudo apt install dconf* -y

Debian

sudo apt-get install dconf* -y

Arch Linux

sudo pacman -S dconf

Fedora

sudo dnf install dconf

OpenSUSE

sudo zypper install dconf

Generic Linuxes

Using an obscure Linux distribution and not sure how to re-install Dconf? Open up your terminal and search your package manager tool for “dconf”.

Can’t find it? Consider turning to something like Pkgs.org, or your distribution’s official documentation.

Dumping The Database

As the Mate desktop environment has all of its data in Dconf, you’ll need to export the database information to back your setup up. To start the extraction process with Dconf, open up a terminal window.

In the terminal window, it’s critical that you do not try to use the sudo command, or gain root with su. Desktop environments do not use the root user, or root file system to set up a working environment, so attempting this will fail to back up anything. Instead, run all commands with your regular user.

Backup All Of Dconf

The most straightforward way to backup the Mate desktop settings is to forget about trying to figure out what area of Dconf needs backing up specifically and instead creating a large copy of every single piece of data available in it.

This way is time-consuming, as the dumping process accounts for everything Dconf has to offer, but the benefit is that no matter what you’re sure to get a reliable backup of your Mate desktop setup on Linux.

dconf dump / > ~/Desktop/dconf-full-backup

Verify that the backup of Dconf works by looking at the content of the file, using the cat command. Combine it with more to make looking at it line-by-line easier.

cat ~/Desktop/dconf-full-backup | more

If everything in the file looks satisfactory, the backup of Dconf is successful. Feel free to take this backup and place it on Dropbox, Google Drive, MEGA or whatever you use for Cloud Storage on Linux.

Backup Only Mate desktop

An alternative to backing up everything is to tell Dconf to only export items in /org/mate, rather than everything. Going this route is safe, as it covers all of the Mate desktop information on your Linux PC. However, it will not back up other areas on your Linux PC that Dconf handles, so keep that in mind.

Start the exporting process by entering the following command in a terminal.

dconf dump /org/mate > ~/Desktop/dconf-mate-backup

Take a look at the backup to ensure that the export went through by running the cat command.

cat ~/Desktop/dconf-mate-backup | more

If the backup file looks good, upload the backup somewhere for safekeeping.

Back Up Themes And Icons

Backing up your desktop settings isn’t going to save your custom icons and theme files. If you want to back up these, you’ll need to create a Tar archive. In a terminal, compress both the ~/.themes and ~/.icons folders.

Note: if your custom themes and icons are installed system-wide, rather than for a single user, you’ll need to create backups of /usr/share/icons and /usr/share/themes/ instead.

tar -czvf icons-backup.tar.gz ~/.icons

tar -czvf themes-backup.tar.gz ~/.themes

Or:

tar -czvf icons-backup.tar.gz  /usr/share/icons 

tar -czvf themes-backup.tar.gz /usr/share/themes/

Restoring The Backup

To restore your Mate desktop environment backup, open up a terminal window and CD to the folder where you keep your backup. In our guide, the backup is saved in the ~/Documents folder.

cd ~/Documents

Next, use the Dconf command and restore your backup. To restore a full backup, do the following command in a terminal:

dconf load / < dconf-full-backup

Restoring the desktop-only backup works the same way as the full backup. Just use the dconf load command and point it to the backup file.

dconf load /org/mate/ < dconf-mate-backup

Loading the backup file into Dconf will load all of your preferences into the Mate desktop. The changes should happen automatically, though it’s a good idea to reboot just in case.

Restore Icons And Themes

The Mate desktop settings are back to normal, thanks to restoring the backup in Dconf. The last step is to restore your icons and themes. To do that, move your themes-backup.tar.gz and icons-backup.tar.gz files to ~/Desktop, and then use the following decompression command.

tar -xzvf icons-backup.tar.gz -C ~/
tar -xzvf themes-backup.tar.gz -C ~/

Or:

sudo tar -xzvf icons-backup.tar.gz -C /usr/share/

sudo tar -xzvf themes-backup.tar.gz -C /usr/share/

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.