Backing up and restoring application settings newly installed on a Linux system
Today we are going to learn about a similar tool called “Mackup”which is used to back up and restore application settings on an installed Linux system. Mackup uses Dropbox to keep the application settings in sync so that you can restore the settings to any installed system at any time. Please remember that Mackup is not designed to restore application settings on different operating systems. The source and destination must have the same version of the app installed. However, if you happen to reinstall the OS, Mackup can help you back up the application settings from the old system and restore them to the newly installed system, thereby saving a lot of time and effort.
We believe the author of mackup should have developed it mainly for Mac OS. So, the word mackup is only from words Mac and Backup… However, Mackup should also work on other operating systems that support Python… Using Mackup, we can restore the settings of popular applications such as Adobe Photoshop, Bash, Chef, Docker, Emacs, Fish, Git, Heroku, i3, JSHint, Kdenlive, Libre Office, Mac OS X, MATLAB, MySQL, Microsoft Asure CLI, NPM, openSSH, Perl, R language, Spotify, Terminal, Vim, WordPress CLI, Xcode, Zsh and many more. You can view the full list of supported applications at https://github.com/lra/mackup#supported-applications, and of course, if your favorite software is missing, you can ask the developer to add it through the GitHub page which linked at the end of this manual.
Backing up and restoring application settings on a newly installed Linux system
Installing Mackup
Make sure you have installed Dropbox on your original system.
Since Mackup is a Python application, it can be easily installed using PIP. If you haven’t installed PIP already see the following link.
- How to manage Python packages with pip
After installing PIP, run the following command to install Mackup.
$ pip install --upgrade mackup
After that, install mackup using the command:
$ brew install mackup
Now, let’s go ahead and see how to back up and restore application settings.
Application backup settings
Now, let’s backup the application settings with the command:
$ mackup backup
Enter Yesto create a new folder named “Mackup” in your local Dropbox folder to sync configuration files for synced storage. Just use this the first time you use Mackup. Please note that by default this will sync the private keys used by OpenSSH and GnuPG.
As we mentioned earlier, Mackup will back up and save your app settings to Dropbox by default. You can, however, configure mackup to exclude applications or use a different backend like google_drive, copy and file_system, with file .mackup.cfg…
Restoring application settings on an installed Linux system
Go to your new Linux system and install Mackup and Dropbox as described in the Installation section. Then, restore the application settings using the command:
$ mackup restore
Mackup will ask you to replace the existing backup file. Enter Yes and press ENTER to restore all configuration files.
Restoring .bashrc ... You already have a file named .bashrc in your home. Do you want to replace it with your backup ? <Yes|No>Yes Restoring .profile ... You already have a file named .profile in your home. Do you want to replace it with your backup ? <Yes|No>Yes Restoring .bash_logout ... You already have a file named .bash_logout in your home. Do you want to replace it with your backup ? <Yes|No>Yes
It is so simple.
To restore everything as it was before using Mackup, simply run:
$ mackup list
To restore everything as it was before using Mackup, simply run:
$ mackup uninstall
Enter Yesto revert all changes.
You are going to uninstall Mackup. Every configuration file, setting and dotfile managed by Mackup will be unlinked and moved back to their original place, in your home folder. Are you sure ? <Yes|No>Yes Reverting .bashrc ... /usr/bin/chattr: Operation not supported while reading flags on /home/ostechnix/.bashrc Reverting .profile ... /usr/bin/chattr: Operation not supported while reading flags on /home/ostechnix/.profile Reverting .bash_logout ... /usr/bin/chattr: Operation not supported while reading flags on /home/ostechnix/.bash_logout All your files have been put back into place. You can now safely uninstall Mackup. Thanks for using Mackup !
For help, run:
$ mackup -h
Unlike aptik utility, Mackup will work on all Linux operating systems. Moreover, it will only backup and restore application settings.