# Joruri CMS 2020 Release 6 アップグレードマニュアル ## 1.想定環境 Joruri CMS 2020 Release 5最新版をインストール済みとします。 ## 2.事前確認 rootユーザーに変更します。 $ su - Joruri CMS 2020 Release 5の最新版がインストール済みであることを確認します。 # cd /var/www/joruri # git log -1 ## 3.インストール ### nginx nginxをインストールします。 # dnf -y install nginx # nginx -v ### ruby rbenvを更新します。 # cd /usr/local/rbenv; git pull # cd /usr/local/rbenv/plugins/ruby-build; git pull # cd /usr/local/rbenv/plugins/rbenv-vars; git pull rubyをインストールします。 # rbenv install 3.4.8 # rbenv global 3.4.8 # rbenv rehash # ruby -v MeCab-Rubyをインストールします。 # cd /usr/local/src/mecab-ruby-0.996 # ruby extconf.rb && make && make install # ldconfig # ldconfig -p | grep "/usr/local/lib" ### node.js nodenvを更新します。 # cd /usr/local/nodenv; git pull # cd /usr/local/nodenv/plugins/node-build; git pull nodejsをインストールします。 # nodenv install 24.12.0 # nodenv global 24.12.0 # nodenv rehash # node -v pnpmをインストールします。 # npm install -g pnpm # nodenv rehash # pnpm -v ## 4.サービスの停止 delayed_jobがジョブを実行中でないことを確認します。 実行中であれば完了するまで待機します。 # ps aux | grep delayed_job delayed_jobを停止します。 # systemctl stop joruri_delayed_job # systemctl status joruri_delayed_job pumaを停止します。 # systemctl stop joruri_puma # systemctl status joruri_puma crondを停止します。 # systemctl stop crond # systemctl status crond ## 5.Joruriのアップグレード joruriユーザーに切り替えます。 # su - joruri $ cd /var/www/joruri Gemfile.lockの変更を破棄します。 $ cp Gemfile.lock tmp/Gemfile.lock $ git checkout Gemfile.lock Joruriを更新します。 $ git pull $ git log -1 gemライブラリを更新します。 $ bundle install $ bundle list nodejsモジュールを更新します。 $ rm -rf node_modules $ pnpm install --production $ pnpm list $ bin/install/assets.sh データベースを更新します。 $ bundle exec rake db:migrate RAILS_ENV=production アセットをコンパイルします。 $ bundle exec rake assets:precompile RAILS_ENV=production $ ls -l public/_common/assets/ _commonディレクトリをsites/xxxx/public/_commonにコピーします。 $ bundle exec rake joruri:maintenance:common_dir:copy RAILS_ENV=production nginx設定ファイルを再書き出しします。 $ bundle exec rake joruri:cms:sites:update_server_configs RAILS_ENV=production nginxベーシック認証ファイルを再書き出しします。 $ bundle exec rake joruri:cms:sites:update_basic_auth RAILS_ENV=production 周期実行ジョブを再登録します。 $ bundle exec rake joruri:core:jobs:schedule RAILS_ENV=production 再構築を実行します。 $ bundle exec rake joruri:cms:tool:rebuild RAILS_ENV=production ## 6.サービスの起動 rootユーザーに切り替えます。 $ su - delayed_jobを起動します。 # systemctl start joruri_delayed_job # systemctl status joruri_delayed_job pumaを起動します。 # systemctl start joruri_puma # systemctl status joruri_puma crondを起動します。 # systemctl start crond # systemctl status crond nginxを起動します。 # systemctl restart nginx