Skip to content

Instantly share code, notes, and snippets.

@jfro
Last active December 14, 2015 06:09
Show Gist options
  • Save jfro/5040378 to your computer and use it in GitHub Desktop.
Save jfro/5040378 to your computer and use it in GitHub Desktop.
Untested upgrade script for Redmine, hopefully can streamline upgrading an install.
#!/bin/sh
VERSION=2.2.3
URL=http://files.rubyforge.vm.bytemark.co.uk/redmine/redmine-$VERSION.tar.gz
SITES_DIR=/home/sites
SITE=example.com
cd $SITE_DIR
curl -O $URL
tar zxf redmine-$VERSION.tgz
rm redmine-$VERSION.tgz
OLD=$SITE_DIR/$SITE
NEW=$SITE_DIR/redmine-$VERSION
# copy configuration, files, & plugins to new install
cp $OLD/config/database.yml $NEW/config/
cp $OLD/config/configuration.yml $NEW/config/
cp -R $OLD/files/* $NEW/files/
cp -R $OLD/plugins/* $NEW/plugins/
cd $NEW
mkdir public/plugin_assets
bundle install --without development test mysql
rake generate_secret_token
rake db:migrate RAILS_ENV=production
rake redmine:plugins:migrate RAILS_ENV=production
rake tmp:cache:clear
rake tmp:sessions:clear
mv $OLD ${OLD}_bak
mv $NEW $OLD
touch $OLD/tmp/restart.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment