Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@corny
Created February 26, 2019 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corny/307d0e44afdeb87527b8aada0dc76701 to your computer and use it in GitHub Desktop.
Save corny/307d0e44afdeb87527b8aada0dc76701 to your computer and use it in GitHub Desktop.
Notes to Upgrade OTRS 2.2 to 4.0
#/bin/sh
host="otrs.example.com"
pass="topsecret"
rsync -av $host:/var/lib/mysql /var/lib/ --exclude usr_\* --exclude confixx --delete
rsync $host:/etc/mysql/debian.cnf /etc/mysql/
# Perl-Pakete für OTRS
apt install --no-install-recommends libtimedate-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libpdf-api2-perl libsoap-lite-perl libgd-text-perl libtext-csv-xs-perl libjson-xs-perl libgd-graph-perl libapache-dbi-perl libcrypt-eksblowfish-perl libarchive-zip-perl libtemplate-perl libyaml-libyaml-perl
# OTRS-Versionen herunterladen und entpacken
for version in 2.3.6 2.4.15 3.0.22 3.1.21 3.2.18 3.3.16 4.0.21; do
curl https://ftp.otrs.org/pub/otrs/otrs-$version.tar.bz2 | tar -xj -C /opt
ln -sf /etc/otrs/Config.pm /opt/otrs-$version/Kernel/
done
# MariaDB installieren
apt install mariadb-server --no-install-recommends
rm /var/lib/mysql/my.cnf
# Datenbanken upgraden
UPDATE mysql.user SET password=PASSWORD("$pass") WHERE User='root';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '***';
mysql_upgrade --defaults-file=/etc/mysql/debian.cnf
mysql -e "SELECT CONCAT('ALTER TABLE \`', table_name, '\` ENGINE=InnoDB;') AS sql_statements FROM information_schema.tables WHERE table_schema='otrs2' AND ENGINE='MyISAM';" | grep ALTER | mysql otrs2
# /opt/otrs-3.0.22/Kernel/System/HTMLUtils.pm fixen
# https://github.com/OTRS/otrs/commit/1a4d22a6ce78ceff53fd8730dfea1039a62cd0e5
scp HTMLUtils.pm-2.4 root@$host:/opt/otrs-2.4.15/Kernel/System/HTMLUtils.pm
scp HTMLUtils.pm-3.0 root@$host:/opt/otrs-3.0.22/Kernel/System/HTMLUtils.pm
scp DBUpdate-to-2.*.mysql.sql root@$host:/opt/otrs-2.3.6/scripts/
scp DBUpdate-to-3.0.mysql.sql root@$host:/opt/otrs-3.0.22/scripts/
scp DBUpdate-to-3.2.mysql.sql root@$host:/opt/otrs-3.2.18/scripts/
scp DBUpdate-to-3.3.mysql.sql root@$host:/opt/otrs-3.3.16/scripts/
scp upgrade.sh root@$host:
# Apache installieren
apt install apache2 libapache2-mod-perl2
cp /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/conf-available/otrs.conf
a2enconf otrs
# Permissions
adduser otrs
usermod -g www-data otrs
/opt/otrs/bin/otrs.SetPermissions.pl --otrs-user=otrs --otrs-group=otrs --web-user=www-data --web-group=www-data /opt/otrs
# Crontab
*/5 * * * * /opt/otrs/bin/otrs.Scheduler.pl -w 1 >> /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment