ILIAS-7-Install-Tutorial for Ubuntu 20.04

Rsyncing files and DBs

Create a Sync Script 16.bbs.ilias.de ->18.bbs-ilias.de

  • Logon to the source system 16.bbs-ilias.de
  • touch sync_to_new
  • chmod +x sync_to_new
  • nano sync_to_new
  • Paste this code in:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

#SSH-data (target host 18.bbs-ilias.de)
ruser=root
rhost=176.28.20.22
rport=22

dbpath=/opt/dbsync

echo "Save databases to file"
/etc/init.d/apache2 stop

DB_NAME=db1
user=user1
pass=123

mysqldump -u${user} -p${pass} ${DB_NAME} > ${dbpath}/${DB_NAME}.sql --skip-lock-tables

DB_NAME=
user=
pass=

mysqldump -u${user} -p${pass} ${DB_NAME} > ${dbpath}/${DB_NAME}.sql --skip-lock-tables

/etc/init.d/apache2 start

echo "syncing Folders"

echo "dbs"
rsync -avrog --delete -e "ssh -p${rport}" /opt/dbsync/ ${ruser}@${rhost}:/opt/dbsync/

echo "client nurderhsv"
rsync -avrog --delete -e "ssh -p${rport}" /opt/iliasdata/nurderhsv/ ${ruser}@${rhost}:/opt/iliasdata/nurderhsv/
rsync -avrog --delete -e "ssh -p${rport}" /var/www/html/ilias/data/nurderhsv/ ${ruser}@${rhost}:/var/www/html/ilias/data/nurderhsv/
  • Fill in your credentials. You can find them here for example:
    • /opt/etherpadlite/settings.json
    • /var/www/html/ilias/data/clientname/client.ini.php
  • Doubble the lines if necessary
  • Take a snapshot before you run the script on both servers
  • Be careful with the rsync option (better run without for the first time) --delete
  • mkdir /opt/dbsync
  • ./sync_to_new

Creating the Databases and Users at the target system

  • With the credentials that you used before in the syncscripts do the following in the target system:
  • mysql
  • Create Database "ilias": mysql> CREATE DATABASE ilias CHARACTER SET utf8 COLLATE utf8_general_ci;
  • Create Databaseuser "dbuser1": mysql> CREATE USER 'dbuser1'@'localhost' IDENTIFIED BY 'USER_PASSWORD';
  • Give user "dbuser1" rights to database "Ilias": mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON ilias.* TO 'dbuser1'@'localhost';

How to fill the new database with the backup from the source system

  • Login to the target system 18.bbs-ilias.de
  • cd /opt/scripts
  • touch dbup
  • chmod +x dbup
  • Find out if you need user credentials for mysql:
    • mysql
    • exit
  • If this worked, then you need none
  • nano dbup
  • paste the following code in (if you need credentials, use the 2nd script):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

dbpathsource=/opt/dbsync
cd $dbpathsource


name=dbname1
yes | mysqladmin drop ${name};
yes | mysqladmin create ${name} --default_character_set=utf8
mysql ${name} < ${name}.sql

name=dbname2
yes | mysqladmin drop ${name};
yes | mysqladmin create ${name} --default_character_set=utf8
mysql ${name} < ${name}.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

dbpathsource=/opt/dbsync
cd $dbpathsource


user=user123
pass=secretpass123
name=iliasdb1

yes | mysqladmin -u ${user} -p${pass} drop ${name};
yes | mysqladmin -u ${user} -p${pass} create ${name} --default_character_set=utf8
mysql -u${user} -p${pass} ${name} < ${name}.sql

user=
pass=
name=

yes | mysqladmin -u ${user} -p${pass} drop ${name};
yes | mysqladmin -u ${user} -p${pass} create ${name} --default_character_set=utf8
mysql -u${user} -p${pass} ${name} < ${name}.sql

echo "Done"

Adjust rightsettings

  • chown -R www-data:www-data /var/www/html/ilias
  • chown -R www-data:www-data /opt/iliasdata
  • chmod -R 775 /var/www/html/ilias
  • chmod -R 770 /opt/iliasdata

Test the source server 18.bbs-ilias.de

  • The basic ILIAS service (no chat, no pad) should work now on the target system
  • Do not spent energy in testing the chat until the move has completed


No comment has been posted yet.