In our previous episode of Linux Mint Olivia to Petra we covered the bash script for backing up our Olivia system in preparation for installing a fresh copy of Linux Mint 16 over it. That post includes an overview of our system apps and configuration as well as our approach to Linux Mint upgrades. In brief, the upgrade includes backing up essential data and config info, do a partition format and clean system install, then reinstall our apps and recreate our environment.
Our applications, configuration files, databases and other data are safely stored away on a Copy Cloud drive, the output of our backup bash script. We have four primary file areas as shown in the image below: 1) our home directory config files, 2) a /mintland area for data outside of home, 3) our MySQL and PostgreSQL databases, and 4) system files like /etc/hosts, our apache2 config files, and other system etcetera.
Below is our bash script for reinstalling applications and Olivia configuration files. We’ll cover restoring our MySQL, PostgreSQL and Apache setup in separate posts. A link to the script will be found at the end of the post. As with the bash backup script covered last time, we’ll describe the main sections and will be scrolling a bit to see them in action.
The data, applications and environment configuration re-installation script has the following areas with corresponding numbers in the script image.
- Functions for extracting content from tar.gz files, adding repositories and installing apps from the repository
- Connecting to Ubuntu One for any backed-up content that might be there. We’ve already attached to Copy Cloud services (file manager screenshot above)
- We start by extracting all of our backed-up application and environment configuration data, using our extract() function to untar and simplifying our code logic
- Copy .bashrc and any other content we didn’t tar when backing up
- We’ll use our addrepo() function to add the repository of all of the applications we want to install, along with a description of the repository for future reference
- Updating the Repository can take 30 seconds or so. The design of this installation bash script allows us update it once, saving a lot of time in the upgrade process.
- We can now install our apps from the Repository
- Finally we install any additional applications that aren’t delivered through the repository
If you look at the very end of the installation bash script, you’ll see that we’re installing a Turpial Twitter Client beta. This was added AFTER the script was used to upgrade to Petra and is included here as an example of keeping the script current. If you start using new applications in Petra that you want to include in a future upgrade, doing a quick copy-n-paste here will save time. Same goes for the backup script we covered in Backing Up Olivia. Keep it current as you start using new applications and the next upgrade will be easier than the previous one.
Here’s the link to the bash script in tar.gz format. As with the backup script, you’re on your own with this script, and no issues from using this script are on me. Enjoy!
Next up on our Olivia to Petra Bash are the scripts for restoring MySQL databases and websites.