]> Git — Sourcephile - gargantext.git/blob - devops/upgrade/0.0.6.1.sh
[FIX] script needs backup
[gargantext.git] / devops / upgrade / 0.0.6.1.sh
1 #!/bin/bash
2
3 # To be executed at the root of the project
4
5 # backup
6
7 sudo apt update
8 sudo apt -yy upgrade
9
10 sudo sed -i "s/buster/bullseye/g" /etc/apt/sources.list
11 sudo apt update
12 sudo apt -yy dist-upgrade
13
14 git pull origin dev
15 ./bin/install
16
17 # Database upgrade
18 #./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.0.sql
19 # exec script haskell upgrade
20
21 #./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.1.sql
22 # ~/.local/bin/gargantext-upgrade
23
24 sudo -i -u postgres bash << EOF
25 pg_dumpall > /tmp/backup.dump
26 EOF
27
28 sudo sed -i "s/bullseye/bookworm/g" /etc/apt/sources.list
29 sudo apt update
30 sudo apt -yy dist-upgrade
31 sudo apt install -y postgresql-14 libpq-dev
32
33 sudo -i -u postgres bash << EOF
34 psql < /tmp/backup.dump
35 EOF
36
37 sed -i "s/DB_PORT = 5432/DB_PORT = 5433/" gargantext.ini
38 DBPASS=$(grep "DB_PASS" gargantext.ini | sed "s/^.*= //")
39
40
41
42 sudo -i -u postgres bash << EOF
43 psql < 'ALTER ROLE gargantua password \'$DBPASS\'';
44 EOF
45
46
47 ./bin/psql gargantext.ini < devops/postgres/upgrade/0.0.6.2.sql
48
49
50
51
52