Upgrading from CentOS 5.6 to CentOS 6.0
If you only have been using CentOS for a while, you might already be aware of how to upgrade to the latest release using the “yum update” command. However what you may be unaware of is that the “yum update” command can only be used for upgrading to the latest minor release. Generally this is because a major release will contain major security fixes, kernel updates and new applications.
Whether you are using CentOS as a personal desktop or as a server, if you want to upgrade to the latest major release in most cases you will need to download and install everything again from scratch. As a systems administrator this can be a time consuming and somewhat tedious task, so here are a few steps that you can take to simplify the process.
cat /etc/redhat-release – Show current version
uname –a – Show current version and kernel version
rpm –q kernel – Show kernel version
yum –y update – Update all your applications and CentOS to the latest minor release
Backing up your MySQL
The first thing you will need to do, particularly if you are running a web server is to backup MySQL. There are a few options you can take to backup MySQL, for example if you have phpMyAdmin installed, you can simply click export and select the type of file you want your tables exported to.
You can also use one of the tools that comes standard with MySQL, mysqldump. To export the contents of a MySQL database using mysqldump, enter the command below with your username and password, followed by the name of the database. In this example db_1 is the name of the database I am exporting.
mysqldump –u root –p password db_1 > db_1.sql
This will produce a .sql file containing all the table information. You can import the .sql file into your new version of CentOS using a similar command. Although be aware that you will need to configure the username and password before you import the database contents.
mysqldump –u root –p password db_1 < db_1.sql
If you are unaware of which databases your server has running, you can use the following query to find out.
mysql –u root -p
List all applications installed
You can also use yum to generate a list of all the applications installed on CentOS 5.6 before migrating. I find this useful because you can use this list to re-install the applications on CentOS 6, although some of them may already be installed by default.
yum list | grep installed > installed.txt
Backup files and configurations
The simplest way to backup files and configurations for CentOS is simply just to compress certain directories into a tarball. There are several applications that you can use to backup Linux, some of which are available throughout this site, but in this instance I will be using tar as to make it simple and perverse file permissions.
Before you begin, it’s a good idea to figure out which directories you want to keep and which you don’t. It’s a good idea to create a backup of your /root /home /var and /etc directories, however I do not recommend backing up your binary directories, you should simply reinstall the applications and backup the config files.
The following command can be used to backup the directories which I have chosen, (Note: Make sure not to add the backup tarball to the directory which you will be backing up)
tar cvf /backup.tar /root /home /var /etc
If you don’t want to see the verbose output you can also use -cf and then verify the contents and permissions inside the tar file later by using the following command.
tar tvf backup.tar
You can extract the files onto the new version of CentOS 6 using the command
tar xf backup.tar
Retaining users and groups
Some files and folders you will be able to replace when installing CentOS 6, depending on the versions of certain applications you’re using. In most cases you will be able to replace alot of the files from the old system that you backed up; some should be used as a reference– though I will leave that up to your digression.
One such example of files that you can replace when migrating to the new version of CentOS is the users and groups files. Backing up these files allows you to transfer all of your old users and groups onto the new system with very little disruption, it is also important if you want to retain certain file permissions.
There are four main user and group files which you can backup and replace onto CentOS 6, all of which have been covered in the backup.
/etc/passwd – Contains user and home directory information
/etc/shadow – Contains the encrypted passwords for each user
/etc/group – Contains information about which each group users belong to
/etc/gshadow – Contains group password information
Like us on Facebook
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Manage Databases And Hosted Servers Remotely With DbNinja : Database administration via command line is bit difficult for newbie system and database administrat...0 comments |
- Install Sayonara Player In Elementary OS / Ubuntu / Linux Mint : Sayonara is a small, clear and fast audio player for Linux written in C++, supported by the Qt frame...0 comments |
- How To Install Linux Kernel 3.12.4 In Ubuntu : Linux Kernel 3.12.4 has been officially released with fixes for inet6_init() cleanup order, seqlock ...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Firefox 26 Has Been Released, How To Install It In Ubuntu And Its Derivates : Hi guys, Firefox 26 has been released for Windows, Mac OS X, Linux and Android devices. It brings m...0 comments |
- How To Install Linux Kernel 3.12.4 In Ubuntu
- Firefox 26 Has Been Released, How To Install It In Ubuntu And Its Derivates
- How To Install Brasero In Elementary OS ‘Luna’
- Install Sayonara Player In Elementary OS / Ubuntu / Linux Mint
- Manage Databases And Hosted Servers Remotely With DbNinja
- Install FrostWire 5.6.9 In Elementary OS ‘Luna’/ Ubuntu / Linux Mint
- Setup IT And Asset Management System With GLPI On Debian/Ubuntu
- How To Configure Linux Clients To Authenticate Using OpenLDAP
- How To Install Netflix In Ubuntu
- cowsay And fortune Combined Together
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .