Upgrading CentOS 6 to CentOS 7

Pre Task

Ada beberapa yang harus dilakukan sebelum melakukan upgrade. Seperti :

Centos Upgrade Repository

Buatlah sebuah file repository baru :

# cat > /etc/yum.repos.d/centos-upgrade.repo << EOF


Pertama yang harus dipasang adalah openscap dari versi dev.centos.org :

# yum -y install https://buildlogs.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm

kemudian baru pasang redhat upgrade tool :

# yum -y install redhat-upgrade-tool preupgrade-assistant-*


# rpm --import http://mirror.centos.org/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7


Untuk bypass error seperti di bawah ini :

Downloading failed: invalid data in .treeinfo: No section: ‘checksums’

Yang harus dilakukan adalah :

mkdir -pv /var/tmp/system-upgrade/base/ /var/tmp/system-upgrade/extras/ /var/tmp/system-upgrade/updates/

echo http://mirror.dionipe.net/Centos/7.7.1908/os/x86_64/ >> /var/tmp/system-upgrade/base/mirrorlist.txt
echo http://mirror.dionipe.net/Centos/7.7.1908/extras/x86_64/ >> /var/tmp/system-upgrade/extras/mirrorlist.txt
echo http://mirror.dionipe.net/Centos/7.7.1908/updates/x86_64/ >> /var/tmp/system-upgrade/updates/mirrorlist.txt


Untuk sebelum memulai upgradenya dengan perintah berikut :

# yes | preupg -v
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
that would require a full re-install of the system from installation media.
Do you want to continue? y/n
Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:00s)
All changed files : 02/11 ...finished (time 00:18s)
Changed config files : 03/11 ...finished (time 00:00s)
All users : 04/11 ...finished (time 00:00s)
All groups : 05/11 ...finished (time 00:00s)
Service statuses : 06/11 ...finished (time 00:00s)
All installed files : 07/11 ...finished (time 00:01s)
All local files : 08/11 ...finished (time 00:01s)
All executable files : 09/11 ...finished (time 00:01s)
RedHat signed packages : 10/11 ...finished (time 00:00s)
CentOS signed packages : 11/11 ...finished (time 00:00s)
Assessment of the system, running checks / SCE scripts:
001/096 ...done (Configuration Files to Review)
002/096 ...done (File Lists for Manual Migration)
003/096 ...done (Bacula Backup Software)
/bin/tar: .: file changed as we read it
Tarball with results is stored here /root/preupgrade-results/preupg_results-180508202952.tar.gz .
The latest assessment is stored in directory /root/preupgrade .
Summary information:
We found some potential in-place upgrade risks.
Read the file /root/preupgrade/result.html for more details.
Upload results to UI by command:
e.g. preupg -u -r /root/preupgrade-results/preupg_results-*.tar.gz .
this must finish without any errors.


Mari kita gunakan perintah berikut untuk memulai upgrade :

# centos-upgrade-tool-cli --network=7 --instrepo=http://vault.centos.org/7.0.1406/os/x86_64/
setting up repos...
getting boot images...
setting up update...
verify local files 100% [=================================================================================================================]
(1/923): GConf2-3.2.6-8.el7.x86_64.rpm                                                                              | 1.0 MB     00:00
(2/923): GeoIP-1.5.0-14.el7.x86_64.rpm                                                                              | 1.5 MB     00:00
. . .
(923/923): zlib-devel-1.2.7-18.el7.x86_64.rpm                                                                       |  50 kB     00:00
testing upgrade transaction
rpm transaction 100% [====================================================================================================================]
rpm install 100% [========================================================================================================================]
setting up system for upgrade
Finished. Reboot to start upgrade.


Untuk proses selanjutkan, silahkan untuk me-reboot system. Kemudian proses tersebut akan ter-upgrade pada versi yang terbaru.

Disclaimer : Create a recent backup of the system. This is an unofficial , unsupported procedure !

Apabila muncul error berikut :

04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2: bla bla

Gunakan perintah berikut :

# cd /var/tmp/system-upgrade/base/ && wget http://mirror.dionipe.net/Centos/7.7.1908/os/x86_64/repodata/04efe80d41ea3d94d36294f7107709d1c8f70db11e152d6ef562da344748581a-primary.sqlite.bz2 ```

Upgrade Centos 6 to Centos 7

Apabila muncul error ini :

/bin/grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

Gunakan perintah berikut :

# ln -s /lib64/libpcre.so.1 /lib64/libpcre.so.0