A while ago, we have published a guide that described how to migrate system settings and data from an old system to newly installed Ubuntu system using Aptik. Today, we are going to learn about a similar tool called "Mackup" which is used to backup and restore application settings to a freshly installed Linux system. Mackup uses Dropbox to keep your application settings in sync, so you can restore the settings on any newly installed system at any time. Please be mindful that Mackup is not meant for restoring application settings across different operating systems. The source and destination should have same version applications installed. That said if you happen to reinstall OS frequently, Mackup can help you to backup the applications settings from the old system and restore them to the newly installed system, thus saving a great amount of time and effort.
I reckon the author of mackup must have developed it mainly for Mac OS. Because, the word mackup is just a portmanteau of Mac and Backup. However, Mackup should also work in any other operating systems that supports 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 a lot more. You can view the complete list of supported applications here. And of course, If your favorite software is missing, you can request the developer's to add it via the GitHub page which is linked at the end of this guide.
Backup And Restore Application Settings On Newly Installed Linux System
Make sure you have installed Dropbox on the source system. If you haven't installed Dropbox already, refer the following link.
Since Mackup is a Python application, we can easily install using PIP. If you haven't installed PIP already, refer the following link.
After installing PIP, run the following command to install Mackup.
$ pip install --upgrade mackup
Mackup can also be installed using Linuxbrew package manager. If you haven't installed Linuxbrew yet, follow the steps provided in the link given below and install it.
After that, install mackup using command:
$ brew install mackup
Now let us go ahead and see how to backup and restore application settings.
Backup Application Settings
Now let use backup the application settings using command:
$ mackup backup
Type Yes to create a new folder named "Mackup" in your local dropbox sync folder and sync your configuration files to your synced storage. Just use this the first time you use Mackup. Please note that by default this will sync private keys used by OpenSSH and GnuPG.
As I mentioned earlier, Mackup will backup and store the application settings in Dropbox by default. You can, however, configure mackup to exclude applications or use a different backend, such as google_drive, copy and file_system, with a .mackup.cfg file. For detailed configuration, refer this link.
Restore Application Settings On Newly Installed Linux system
Go to your newly Linux system and install Mackup and Dropbox as described in the Install section above. Then, restore the application settings using command:
$ mackup restore
Mackup will ask you to overwrite the existing file with the backup files. Type Yes and hit ENTER to restore all configurations 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's that simple.
To view the list of supported applications, just run:
$ mackup list
To reset everything as it was before using Mackup, simply run:
$ mackup uninstall
Type Yes to revert back 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 getting help, run:
$ mackup -h
Unlike aptik utility, Mackup will work on all Linux operating systems. However, Mackup will backup and restore the application settings only. Aptik will backup old PPAs, packages, themes, mount entries, users/groups, Home directory data, and scheduled tasks etc.