2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Growiのバージョンアップ

Posted at

まずは、株式会社WESEEK様に感謝

サーバー(PCですが)入れ替えに伴い最新版にバージョンアップしようとしましたが、躓いたので備忘録。

解決方法

v3.4.4➔ v5.0.5 でGrowiが起動しない
v3.4.4➔ v.4.5.20➔ v5.0.5 で成功

手順

現サーバーにてバックアップ

MongoDB
$ sudo mongodump -o /tmp/growi_backup/growi_2022xxxx/ -d growi

アップロードファイル
$ sudo tar zcvf /tmp/growi_backup/growi_uploads_2022xxxx.tgz /opt/growi/public/uploads/
※バージョンにより格納先が異なるので注意
(2019/10頃~)   /opt/growi/public 
(2021/9頃~)  /opt/growi/packages/app/public 

新サーバーにインポート

バージョン
Growi 4.5.20
node 14.x
npm 6.x
Elasticsearch 6.x
MongoDB 4.4

①MongoDBのインポート
 MongoDBはサービス起動しておく
  $ sudo systemctl start mongod
 ディレクトリ移動
  $ cd /usr/bin
 データインポート
  $ mongorestore -d growi /tmp/growi_2022xxxx/growi/ --drop

②アップロードファイルのコピー
 /opt/growi/packages/app/public/ 配下に『uploads』ディレクトリコピー
 ※パーミッションに注意

③Growi起動
 $ sudo systemctl start elasticsearch
 $ cd /opt/growi
 $ MONGO_URI=mongodb://localhost:27017/growi \ ELASTICSEARCH_URI=http://localhost:9200/growi \ npm start

④Growi設定
 ユーザーも移行されているので管理者でログイン後管理画面にて
  ・【アプリ設定】のアップロード設定で、ファイルアップロード方法を『Local』に変更
  ・【全文検索管理】で、インデックスのリビルド、再接続、正規化を行う

⑤トップ画面に戻り、正常稼働を確認する。

Growi5.0.5へのアップグレード

サービスはすべて停止しておく。

Elasticsearch

プラグインのアンインストール
 $ /usr/share/elasticsearch/bin/elasticsearch-plugin remove analysis-kuromoji
 $ /usr/share/elasticsearch/bin/elasticsearch-plugin remove analysis-icu

レポジトリを新バージョンに書き換え
 $ vi /etc/yum.repos.d/elasticsearch.repo ←新サーバーセットアップ時のファイル

[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

アップデート
 $ yum update -y elasticsearch --enablerepo=elasticsearch-7.*

メモリサイズ設定
 $ vi /etc/elasticsearch/jvm.options
 (デフォルト記述なさそうなので、-Xms1g -Xmx1g を追記した)

プラグイン追加
 $ /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-kuromoji
 $ /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu

サービスが正常起動するか確認
 $ sudu systemctl start elasticsearch

Node.jsのアップグレード

 $ sudu yum remove -y nodejs
 $ sudu curl -sL https://rpm.nodesource.com/setup_16.x | bash -
 $ sudu yum install -y gcc-c++ make
 $ sudu yum install -y nodejs
 $ sudu yum install -y yarn
 ※npmバージョンは6.xとあるが、8.xで問題なさそう。

Growiアップグレード

 $ cd /opt/growi
 $ git fetch --tags
 $ git tag
 $ git stash
 $ git checkout v5.0.5
 $ yarn

※Growi起動後はファイルアップロード先がデフォルトになっているので、Localへ変更必要

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?