-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathfallback_to_5.6.sh
executable file
·42 lines (31 loc) · 1.1 KB
/
fallback_to_5.6.sh
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
35
36
37
38
39
40
41
42
#Pre Step changes image of Mysql back to 5.6 in docker-compose.yml
if [ ! -d ./mysql_backup ]
then
echo "mysql_backup dir doesnt exists, You missed to take up the backup"
exit 1
fi
#step 1 Stopping the database if it is already running
echo " Stop the database if running"
docker-compose stop database
docker-compose rm -f database
#Step 2 Remove the data/mysql/*
echo "Remove the data from mysql/"
rm -rf data/mysql/*
#Step 2 Copy the backup data again to data/mysql
echo "copy the data from backup"
cp -rf mysql_backup/ data/mysql/
#Copy the old configs
echo "Copy old configs"
cp -f old_configs/docker-compose.yml .
cp -f old_configs/nginx.conf ./etc/
cp -f old_configs/1-user.sql initializers/docker-entrypoint-initdb.d/1-user.sql
#start the database container
docker-compose up -d database
echo "Sleeping for 30 seconds"
sleep 30
# Stop the containers
echo " Stopping all containers"
docker-compose stop
echo "********************************************"
echo "Change the TAG in .env file as v20.6"
echo "After this change bring up the containers using docker-compose up -d"