Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Centos Upgrade 4.x to 5.x

103 bytes added, 22:25, 2 June 2011
improved tar based backup/restore
</pre>
== Enter container ==
<pre>
vzctl enter $CTID
</pre>
==Install centos-5-release packages==
Use <code>vzctl exec</code> to execute the rpm install command on the container:
<pre>
vzctl exec $CTID rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.6-0.i386.rpm \ http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-5-6.el5.centos.1.i386.rpm
</pre>
Note: centos-release-5 depends on notes-package, start with that one.
==Backup dev==
Backup your the container /dev/ directory, as initscripts needs udev and will remove vzdev you'll need the backup:
<pre>
tar -cf $CTID.dev.tar -C /vz/private/$CTID/dev
</pre>
<pre>
vzctl exec $CTID rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/initscripts-8.45.33-1.el5.centos.i386.rpm --force --nodeps
</pre>
Note: If the "transfer failed", go to the [http://mirror.centos.org/centos/5/os/i386/CentOS/ CentOS5 mirror] and find the latest initscripts rpm and use that instead.
 
==Exit from container==
<pre>
exit
</pre>
==Update conf file==
</pre>
==Replace Restore dev== This will replace the new /dev/ with the old one==:
<pre>
cd mv /vz/private/$CTIDmv /dev /vz/private/$CTID/dev.oldtar -xvf $CTID.dev.tar-C /vz/private/$CTID
</pre>
27
edits