1 |
diff -Nur smeserver-sme9admin-1.5.old/root/etc/e-smith/sql/init/sme9admin smeserver-sme9admin-1.5/root/etc/e-smith/sql/init/sme9admin |
2 |
--- smeserver-sme9admin-1.5.old/root/etc/e-smith/sql/init/sme9admin 2017-07-10 14:33:04.507000000 -0400 |
3 |
+++ smeserver-sme9admin-1.5/root/etc/e-smith/sql/init/sme9admin 2017-07-10 14:41:22.306000000 -0400 |
4 |
@@ -1,10 +1,10 @@ |
5 |
#!/bin/bash |
6 |
|
7 |
# mysql |
8 |
-if [ -d /var/lib/mysql/sme9admin ] && [ ! -d /var/lib/mysql/sme9admin ]; then |
9 |
- echo "Migrating existing sme9admin MySQL database." |
10 |
+if [ -d /var/lib/mysql/sme8admin ] && [ ! -d /var/lib/mysql/sme9admin ]; then |
11 |
+ echo "Migrating existing sme8admin MySQL database." |
12 |
mysqladmin create sme9admin |
13 |
- mysqldump sme9admin | mysql sme9admin |
14 |
+ mysqldump sme8admin | mysql sme9admin |
15 |
PASS=$(/sbin/e-smith/db configuration getprop sme9admind DbPassword) |
16 |
mysql -e " grant all privileges on sme9admin.* to 'sme9admin'@'localhost' identified by '$PASS'" |
17 |
mysqladmin flush-privileges |
18 |
@@ -17,6 +17,11 @@ |
19 |
fi |
20 |
|
21 |
# rrd |
22 |
+ # migrating previous sme8admin rrd |
23 |
+ if [ -d /var/lib/sme8admin ] && [ ! -d /var/lib/sme9admin ]; then |
24 |
+ echo "Migrating existing sme8admin RRDs files." |
25 |
+ cp -vr /var/lib/sme8admin /var/lib/sme9admin |
26 |
+ fi |
27 |
|
28 |
#ADD more DS for version 1.5-10 |
29 |
#first we test if these DS are already in the sensors.rrd |