Firefox 16, a treat for developers http://t.co/cnd27CzT
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.04 ‘Raring Ringtail’ : Ubuntu 13.04 Raring Ringtail final is almost out. The final release it scheduled for release on Apri...0 comment(s) |
- Howto: Upgrade to Ubuntu 13.04 Raring Ringtail from 12.04, 12,10 | Desktop & Server : Updated 05-04-2013: Ubuntu 13.04 Raring Ringtail will be released Soon, If you have ubuntu 12,10, 12...0 comment(s) |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comment(s) |
- Unix/Linux File Recognition. Did You Know? : Did you know that Unix and Linux has no concept of a file extension? What is a file name extension? ...0 comment(s) |
- Configure conky-Lua in Ubuntu (12.10 & 13.04 Raring Ringtail), Fedora, debian and LinuxMint | Howto Conky : Updated 05-04-2013: Conky is a free, light-weight system monitor for X, that displays any informatio...0 comment(s) |
- Howto- Resolve nosound problem on Ubuntu 13.04 Raring Ringtail,12.10 and Older : Updated 05/04/2013 : One of the common issues facing Ubuntu users after installing or upgrading Ubun...0 comment(s) |
- Unix/Linux File Recognition. Did You Know?
- Migrate from MySQL to MariaDB in FreeBSD
- Connect Your Android Galaxy Tablet to Ubuntu via USB
- ElementaryOS Beta 1 and 2 Comparison and Review
- Introduction to the Linux Command Line
- A Secure Password
- Linux Kernel 3.10. It’s BIG!
- Monitoring Users Activity Using psacct or acct Tools in Linux
- Run Your Own Social Network Using elgg on RHEL / CentOS and Scientific Linux
- Getting Debian 7.0 ‘Wheezy’ Up and Running
Copyright © 2008-2013 Unixmen.com .