Feature #26847

implement an upgrade script

Added by fabrice salvaire over 5 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:

Description

User can do mistake when they upgrade an existing instance, for example overwrite files in public from an older release.

Some ideas

#! /bin/bash

redmine_version='3.4.2'
archive_path='...'
www_path='...'

pushd ${www_path}

tar xzf ${archive_path}/redmine-${redmine_version}.tar.gz
chown -R apache.apache redmine-${redmine_version}

pushd redmine-${redmine_version}
cp ${www_path}/redmine/config/database.yml config/
cp ${www_path}/redmine/config/configuration.yml config/
cp -r ${www_path}/redmine/plugins/* plugins/
# cp -r ${www_path}/redmine/public/... public/
cp -r ${www_path}/redmine/files/* files/

# patch -p0 < ${www_path}/redmine-patch.diff

bundle install --without development test
bundle exec rake generate_secret_token

bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production

popd
rm redmine
ln -sf redmine-${redmine_version} redmine

apachectl restart

Also available in: Atom PDF