Commit 924e1dc7 authored by Claes Sjofors's avatar Claes Sjofors

Upgrade procedure update

parent cf044ba9
...@@ -140,7 +140,7 @@ reload_classvolumes() ...@@ -140,7 +140,7 @@ reload_classvolumes()
return return
fi fi
if wb_cmd create snapshot/file=\"$file\"/out=\"$pwrp_load/$volumelow.dbs\" if wb_cmd -q create snapshot/file=\"$file\"/out=\"$pwrp_load/$volumelow.dbs\"
then then
reload_status=$reload__success reload_status=$reload__success
else else
...@@ -289,12 +289,48 @@ reload_cnvobjects() ...@@ -289,12 +289,48 @@ reload_cnvobjects()
reload_continue "Pass convert objects in loaded database" reload_continue "Pass convert objects in loaded database"
for cdb in $databases; do for cdb in $databases; do
wb_cmd -v $cdb @$pwr_exe/upgrade_pb.pwr_com echo "-- Convert volume $cdb"
wb_cmd -q -v $cdb @$pwr_exe/upgrade_pb.pwr_com
done done
reload_status=$reload__success reload_status=$reload__success
} }
reload_updateclasses()
{
reload_checkpass "updateclasses" $start_pass
if [ $pass_status -ne $pass__execute ]; then
reload_status=$reload__success
return
fi
reload_continue "Pass update classes"
for cdb in $databases; do
echo "-- Update classes in volume $cdb"
wb_cmd -q -v $cdb update classes
done
reload_status=$reload__success
}
reload_savedirectory()
{
reload_checkpass "savedirectory" $start_pass
if [ $pass_status -ne $pass__execute ]; then
reload_status=$reload__success
return
fi
reload_continue "Pass save directory volume"
wb_cmd -q -v directory save
reload_status=$reload__success
}
reload_compile() reload_compile()
{ {
reload_checkpass "compile" $start_pass reload_checkpass "compile" $start_pass
...@@ -305,14 +341,8 @@ reload_compile() ...@@ -305,14 +341,8 @@ reload_compile()
reload_continue "Pass compile plcprograms" reload_continue "Pass compile plcprograms"
list=`eval ls -1d $pwrp_db/*.db` for cdb in $databases; do
for file in $list; do wb_cmd -q -v $cdb compile /all
file=${file##/*/}
file=${file%%.*}
if [ $file != "directory" ] && [ $file != "rt_eventlog" ]; then
wb_cmd -v $file compile /all
fi
done done
# wb_cmd compile /all # wb_cmd compile /all
...@@ -345,18 +375,8 @@ reload_createload() ...@@ -345,18 +375,8 @@ reload_createload()
reload_continue "Pass create loadfiles" reload_continue "Pass create loadfiles"
# Remove all old loadfiles for cdb in $databases; do
echo "-- Removing old loadfiles" wb_cmd -q -v $cdb create load/volume=$cdb
rm $pwrp_load/ld_vol*.dat
list=`eval ls -1d $pwrp_db/*.db`
for file in $list; do
file=${file##/*/}
file=${file%%.*}
if [ $file != "directory" ] && [ $file != "rt_eventlog" ]; then
wb_cmd -v $file create load/volume=$file
fi
done done
# wb_cmd create load/all # wb_cmd create load/all
...@@ -378,7 +398,56 @@ reload_createboot() ...@@ -378,7 +398,56 @@ reload_createboot()
reload_continue "Pass create bootfiles" reload_continue "Pass create bootfiles"
echo "-- Creating bootfiles for all nodes" echo "-- Creating bootfiles for all nodes"
wb_cmd create boot/all wb_cmd -q create boot/all
reload_status=$reload__success
}
reload_buildnodes()
{
reload_checkpass "buildnodes" $start_pass
if [ $pass_status -ne $pass__execute ]; then
reload_status=$reload__success
return
fi
reload_continue "Pass build nodes"
echo "-- Build all nodes"
volumes=`eval cat $pwrp_db/pwrp_cnf_bootlist.dat | awk '{ print $1 }'`
for volume in $volumes; do
vclass=`eval grep \"^$volume \" $pwrp_db/pwrp_cnf_volumelist.dat | awk '{ print $3 }'`
if [ "$vclass" == "RootVolume" ]; then
nodes=`eval grep \"^$volume \" $pwrp_db/pwrp_cnf_bootlist.dat | awk '{ print $3 }'`
for node in $nodes; do
echo -- Building node $node
wb_cmd -q -v $volume build node /name=$node
done
fi
done
reload_status=$reload__success
}
reload_createpackage()
{
reload_checkpass "createpackage" $start_pass
if [ $pass_status -ne $pass__execute ]; then
reload_status=$reload__success
return
fi
reload_continue "Pass create packages"
echo "-- Creating distribution packages for all nodes"
nodes=`eval grep "^node " $pwrp_db/pwrp_cnf_distribute.dat | awk '{ print $2 }'`
for node in $nodes; do
wb_cmd -q distribute /node=$node /package
done
reload_status=$reload__success reload_status=$reload__success
} }
...@@ -488,7 +557,7 @@ reload_directorystructure() ...@@ -488,7 +557,7 @@ reload_directorystructure()
reload_exit() reload_exit()
{ {
source pwrp_env.sh setdb #source pwrp_env.sh setdb
exit $reload_status exit $reload_status
} }
...@@ -559,17 +628,19 @@ usage() ...@@ -559,17 +628,19 @@ usage()
{ {
cat << EOF cat << EOF
upgrade.sh Upgrade from V5.2.0 to V5.3.1 upgrade.sh Upgrade from V5.3.1 to V5.4.0
Pass Pass
savedirectory Save directory volume.
classvolumes Create loadfiles for classvolumes. classvolumes Create loadfiles for classvolumes.
renamedb Rename old databases. updateclasses Update classes.
loaddb Load dumpfiles. cnvobjects Create OpPlaceWeb objects.
compile Compile all plcprograms in the database compile Compile all plcprograms in the database
createload Create new loadfiles. createload Create new loadfiles.
createboot Create bootfiles for all nodes in the project. buildnodes Build all nodes in the project.
createpackage Create distribution packages for all nodes in the project.
EOF EOF
} }
...@@ -602,19 +673,19 @@ databases="" ...@@ -602,19 +673,19 @@ databases=""
for db in $tmp; do for db in $tmp; do
db=${db##/*/} db=${db##/*/}
db="${db%.*}" db="${db%.*}"
if [ "$db" != "rt_eventlog" ]; then if [ "$db" != "rt_eventlog" ] && [ "${db:0:6}" != "pwrp__" ]; then
databases="$databases $db" databases="$databases $db"
fi fi
done done
passes="classvolumes renamedb loaddb compile createload createboot" passes="savedirectory classvolumes updateclasses cnvobjects compile createload buildnodes createpackage"
#echo "Pass: $passes" #echo "Pass: $passes"
echo "" echo ""
echo -n "Enter start pass [classvolumes] > " echo -n "Enter start pass [savedirectory] > "
read start_pass read start_pass
if [ -z $start_pass ]; then if [ -z $start_pass ]; then
start_pass="classvolumes" start_pass="savedirectory"
fi fi
for cpass in $passes; do for cpass in $passes; do
......
!** Invisible: Script for moving DSup to DSupComp objects during upgrading from V5.0 to V5.1.0 !** Invisible: Script for to create OpPlaceWeb from WebHandler objects during upgrading from V5.3 to V5.4
! !
# Proview Open Source Process Control. # Proview Open Source Process Control.
# Copyright (C) 2005-2016 SSAB EMEA AB. # Copyright (C) 2005-2016 SSAB EMEA AB.
...@@ -35,73 +35,234 @@ ...@@ -35,73 +35,234 @@
# General Public License plus this exception. # General Public License plus this exception.
! !
! !
! Script for set Attribute in DSupComp objects during upgrading from V5.0 to V5.1.0, ! Script to create OpPlaceWeb objects during upgrading from V5.3 to V5.4,
! !
! Find all DSupComp objects and set Attribute to parent attribute. ! Find all WebHandler objects and create an OpPlaceWeb.
! !
main() main()
string name; string name;
string oname; string opname;
string aname; string aname;
string attr; string aopname;
string attrstr;
int attrint;
string child;
string prevchild;
string class;
string nchild;
string nclass;
int idx; int idx;
int idx0 = 0;
int sts; int sts;
int len;
name = GetClassListAttrRef("DSupComp"); verify(0);
name = GetClassListAttrRef("WebHandler");
while ( name != "") while ( name != "")
idx = strrchr( name, "."); idx = strrchr( name, "-") - 1;
idx -= 1; opname = extract( 1, idx, name);
oname = extract( 1, idx, name); opname = opname + "-OpWeb";
printf( "--\n");
len = strlen( oname); printf( "-- Creating OpPlaceWeb object %s\n", opname);
idx = len - 7; printf( "--\n");
if ( len > 0) sts = CreateObject( "OpWeb", "OpPlaceWeb", name, 3);
attr = extract( idx, len, oname); if ( EVEN(sts))
if ( attr == ".LimitHH") printf( "** Unable to create object %s, sts %d\n", opname, sts);
idx -= 1; quit
oname = extract( 1, idx, oname);
endif
if ( attr == ".LimitLL")
idx -= 1;
oname = extract( 1, idx, oname);
endif
endif endif
len = strlen( oname); aname = name + ".FileName";
idx = len - 6; aopname = opname + ".FileName";
if ( len > 0) attrstr = GetAttribute( aname, sts);
attr = extract( idx, len, oname); if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
if ( attr == ".LimitH") aname = name + ".Title";
idx -= 1; aopname = opname + ".Title";
oname = extract( 1, idx, oname); attrstr = GetAttribute( aname, sts);
endif if ( EVEN(sts))
if ( attr == ".LimitL") printf( "Attribute error: %s\n", aname);
idx -= 1; endif
oname = extract( 1, idx, oname); sts = SetAttribute( aopname, attrstr);
endif if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif endif
aname = name + ".Attribute"; aname = name + ".Text";
if ( oname == "") aopname = opname + ".Text";
printf( "** Not set %s\n", aname); attrstr = GetAttribute( aname, sts);
else if ( EVEN(sts))
sts = SetAttribute( aname, oname); printf( "Attribute error: %s\n", aname);
if ( !(sts & 1)) endif
printf( "** Unable to set %s sts %d\n", aname, sts); sts = SetAttribute( aopname, attrstr);
else if ( EVEN(sts))
printf( "-- Set %s = %s\n", aname, oname); printf( "Attribute error: %s\n", aopname);
endif
endif endif
name = GetNextAttrRef("DSupComp", name); aname = name + ".EnableLanguage";
endwhile aopname = opname + ".EnableLanguage";
attrint = GetAttribute( aname, sts);
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".EnableLogin";
aopname = opname + ".EnableLogin";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".EnableAlarmList";
aopname = opname + ".EnableAlarmList";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".EnableEventLog";
aopname = opname + ".EnableEventLog";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".DisableHelp";
aopname = opname + ".DisableHelp";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".DisableProview";
aopname = opname + ".DisableProview";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".Language";
aopname = opname + ".Language";
attrint = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrint);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".StyleSheet";
aopname = opname + ".StyleSheet";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".StartURL";
aopname = opname + ".StartURL";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".LoadArchives";
aopname = opname + ".LoadArchives";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".PwrHost";
aopname = opname + ".PwrHost";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
aname = name + ".AppletSignature";
aopname = opname + ".AppletSignature";
attrstr = GetAttribute( aname, sts);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aname);
endif
sts = SetAttribute( aopname, attrstr);
if ( EVEN(sts))
printf( "Attribute error: %s\n", aopname);
endif
# Move WebGraph, WebLink, AppGraph and AppLink objects
child = GetChild( name);
prevchild = "";
while ( child != "")
class = GetObjectClass( child);
if ( class == "WebGraph" || class == "WebLink" || class == "AppGraph" || class == "AppLink")
MoveObject( child, opname, 2);
child = prevchild;
endif
if ( class == "$NodeHier")
nchild = GetChild( child);
if ( nchild != "")
nclass = GetObjectClass( nchild);
if ( nclass == "WebGraph" || nclass == "WebLink" || nclass == "AppGraph" || nclass == "AppLink")
MoveObject( child, opname, 2);
child = prevchild;
endif
endif
endif
prevchild = child;
if ( child == "")
child = GetChild( name);
else
child = GetNextSibling( child);
endif
endwhile
name = GetNextAttrRef( "WebHandler", name);
endwhile
save save
endmain endmain
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment