红帽提供了一个非常稳定的PAAS服务平台:openshift!此博客即作为wordpress建在里面。 这里记录如何升级与备份wordpress。
预备: 安装 openshift command line tool rhc:
$gem install rhc
$rhc setup
$rhc apps 得到应用名称=>$APPS
升级wordpress:
$mkdir ~/website
$rhc git-clone $APPS
下载wordpress安装包,例如wordpress-3.9.zip。
$unzip wordpress-3.9.zip
$cd ~/website/$APPS/
$mv $APPS/ bk
$cp wordpress $APPS/
$cp bk/wp-config.php $APPS/
$rm -rfv bk
$git add .
$git commit -m "update to new wordpress3.9."
成功后显示如下信息:
remote: Stopping MySQL 5.1 cartridge
remote: Stopping PHP 5.3 cartridge (Apache+mod_php)
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Stopping PHPMyAdmin cartridge
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Building git ref ‘master’, commit 8f52203
remote: The deplist.txt file was deprecated in favor of .openshift/pear.txt.
remote: Please consider running `git mv deplist.txt .openshift/pear.txt’ command.
remote: Checking deplist.txt for PEAR dependency…
remote: Preparing build for deployment
remote: Deployment id is 3528d784
remote: Activating deployment
remote: Starting MySQL 5.1 cartridge
remote: Starting PHPMyAdmin cartridge 。。。。。。。
备份wordpress(包括数据库和上传文件):
$rhc snapshot save -a $APPS
恢复wordpress:
$rhc snapshot restore $APPS