Created
February 10, 2012 12:39
-
-
Save snickerjp/1789402 to your computer and use it in GitHub Desktop.
OpenVZ-CE5toCE6-x86_64.sh改変
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump --all-databases -p > mysqldump | |
gzip mysqldump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright © y-kawaz氏 | |
# 15分でOK!ServersMan@VPSにSL6(≒CentOS6)を入れる方法 | |
# URL:http://d.hatena.ne.jp/y-kawaz/20110722/1311275547 | |
# Mod:snicker_jp | |
# 作業のジャマなので不要なプロセスを停止 | |
/etc/init.d/ajaxterm stop | |
/etc/init.d/crond stop | |
/etc/init.d/httpd stop | |
/etc/init.d/saslauthd stop | |
/etc/init.d/syslog stop | |
/etc/init.d/xinetd stop | |
# 追加 mysqld止める | |
/etc/init.d/mysqld stop | |
# 公開されてるCE6のテンプレートを元に新環境を作る | |
mkdir /CE6 | |
curl http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz | tar xfzv - -C /CE6 | |
/bin/cp -ap /etc/resolv.conf /CE6/etc/ | |
/bin/cp -ap /etc/sysconfig/network /CE6/etc/sysconfig/ | |
/bin/cp -ap /etc/sysconfig/network-scripts/ifcfg-venet0* /CE6/etc/sysconfig/network-scripts/ | |
/bin/cp -ap /etc/ssh/ssh* /CE6/etc/ssh/ | |
/bin/cp -ap /aquota.group /CE6/ | |
/bin/cp -ap /aquota.user /CE6/ | |
ln -sfn /usr/share/zoneinfo/Japan /CE6/etc/localtime | |
# 現行システムとCE6を入れ替える | |
yum -y install busybox | |
mkdir /CE5 | |
/sbin/busybox mv /* /CE5/ | |
/CE5/sbin/busybox mv /CE5/CE6/* / | |
# 追加 /home以下の移動 | |
/CE5/sbin/busybox mv /CE5/home/* /home/ | |
/etc/init.d/syslog start | |
# 終わり | |
echo "必ず!passwd コマンドで新環境のパスワードを設定すること" | |
echo "デフォルトはパスワード未設定なのでそのままだとログインできなくなります。" | |
echo "管理コンソールから、停止(5分くらい?)→起動(2分くらい)すればCE6が起動します。" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time sh OpenVZ-CE5toCE6-x86_64_kai.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment