升级Ghost

环境:CentOS 6.3

[root@AY1406151605405725a8Z ghost]# ls -l
total 108
-rw-rw-rw-  1 root root  1132 Sep 25 18:46 bower.json
-rw-rw-rw-  1 root root  3916 Sep 25 18:46 config.example.js
-rw-r--r--  1 root root  4332 Jun 15 19:00 config.js
drwxr-xr-x  6 root root  4096 Jun 15 17:46 content
drwxr-xr-x  6 root root  4096 Sep 25 18:46 core
-rw-rw-rw-  1 root root 49581 Sep 25 18:46 Gruntfile.js
-rw-rw-rw-  1 root root   864 Sep 25 18:46 index.js
-rw-rw-rw-  1 root root  1121 Sep 25 18:46 LICENSE
drwxr-xr-x 35 root root  4096 Sep 26 22:17 node_modules
-rw-rw-rw-  1 root root  3248 Sep 25 18:46 package.json
-rw-rw-rw-  1 root root  2640 Sep 25 18:46 PRIVACY.md
-rw-rw-rw-  1 root root  6208 Sep 25 18:46 README.md
[root@AY1406151605405725a8Z ghost]# ls
bower.json         config.js  core          index.js  node_modules  PRIVACY.md
config.example.js  content    Gruntfile.js  LICENSE   package.json  README.md
[root@AY1406151605405725a8Z ghost]#

Ghost 安装后,有一个与左边图片相似的文件夹结构,包括两个主要的目录 content 和 core ,和其他一些文件。
更新 Ghost 也无非就是将旧文件替换为新文件,重新运行 npm install 更新 node_modules 文件夹,然后重新启动 Ghost 使生效。
记住,Ghost 默认将所有的自定义数据,主题,图片等存储到 content 目录下,所以确保此目录安全!只替换 core 目录和根目录下的文件,一切就会正常。

#备份镜像与数据
#停止项目
#forever stop index.js

image

  • 为了备份你的数据库中的所有数据,启动 Ghost 访问 /ghost/debug/ 并且登录。点击蓝色的 EXPORT 按钮,将会下载下一个包含你所有数据的 JSON 文件。
  • 为了备份你的所有的自定义主题和图片,你需要复制一份 content/themescontent/images内的文件。

image

#下载最近包(翻X)
http://ghost.org/zip/ghost-latest.zip (https://github.com/TryGhost/Ghost/releases)
#删除core与node_modules目录
rm -rf   /opt/ghost/core
rm –rf  /opt/ghost/node_modules
#解压新包(会覆盖默认主题,如果自己修改了主题,记得备份)
unzip -uo ghost-latest.zip -d ghost
#安装
#npm install --production
#启用服务
NODE_ENV=production forever start index.js
Tip:
1.登陆页面(目录core/server/views)
https://fonts.googleapis.com/css?family=Open+Sans:400,300,700 需要换国内镜像 http://libs.useso.com/
2.SQLite3错误 ,可以源码  npm install sqlite3 --build-from-source

错误 forever start -l forever.log -o out.log -e err.log debug.js http://wenxin2009.iteye.com/blog/1751546

Refer:
https://ghost.org/forum/installation/
http://support.ghost.org/how-to-upgrade/
http://docs.ghostchina.com/zh/installation/upgrading/

 
原文地址:https://www.cnblogs.com/Irving/p/3995768.html