I have a vortex script called MoveAndGoLive. This enables me to respider my site from one box, but then copy the resulting files from the db1 or db2 directories on that box a dbtemp directory on another box, then run this program to do the following: determine which is currently live (db1 or db2),
copy the dbtemp files to the non-live directory, and
then flip the switch, making the other directory (with the new files) live.
It used to work fine. Now it doesn't. I'm wondering if this is another symptom of the newer version of Webinator, for which I mistakenly applied the vfpatch, when I shouldn't have.
But, I tested running with the copy of texis that's in the install directory, and it still doesn't work.
Here are the details:
Version of Texis in the install dir:
Texis Web Script (Vortex) Copyright (c) 1996-2003 Thunderstone - EPI, Inc.
Commercial Webinator Version 4.02.1046967833 of Mar 6, 2003 (i686-intel-winnt-32-32)
Version of Texis in the cgi-bin dir:
Texis Web Script (Vortex) Copyright (c) 1996-2002 Thunderstone - EPI, Inc.
Commercial Webinator Version 4.02.1031937844 of Sep 13, 2002
I tried both of those, with the same/similar results.
MoveAndGoLive.bat:
REM ===============================================
REM File: MoveAndGoLive.bat
REM Purpose: Copy New files from dbtest to
REM db2 or db1, and flip the active
REM db to the one just copied.
REM ===============================================
d:\thunderstonesoftware\webinator\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"
MoveAndGoLive (Vortex):
<SCRIPT LANGUAGE=vortex>
<TIMEOUT=-1></TIMEOUT>
<!--
--------------------------------------------------------------------
File: MoveAndGoLive
Purpose: Webinator DBs are rewalked on one machine, and then the
resulting updated DB files are copied to the production
machine, into a temporary directory. We have to clear
out the receiving directory, copy the files from the temp
directory to the receiving directory, and then flip the
switch from the old active directory to the new one.
History:
15-Jan-2003 jamon Changed Copyright for 2003
jamon Activated for all profiles
jamon Remove trailing / from dest_dspace
21-Oct-2002 jamon Added "glob" to the <sysutil delete...
jamon Added this file header.
16-Oct-2002 jamon New file
--------------------------------------------------------------------
(c) 2002-03 Moen Incorporated
All code is the property of Moen Incorporated
--------------------------------------------------------------------
-->
<A NAME=main public>
<vxinfo installdir>
<sum "%s" $ret "/texis/">
<$defaultdir=$ret>
<!-- For each primary profile: -->
<!-- Go get the current live directory (db1 or db2) -->
<!-- Set variables for source and destination for the copy -->
<!-- Do the copy -->
<!-- Flip the switch -->
<$testdbdir="TestDB">
<sum "%s" $defaultdir $testdbdir>
<$testdb=$ret>
<$profiles= "Consumer" "Builder" "Designer" "Plumber" "Retailer" "Remodeler" "Wholesaler" "MechanicalEngineer" >
<!-- $profiles= "Builder" -->
<loop $profiles>
Profile: $profiles
<sql db=$testdb "select String from options where Profile=$profiles and Name='SS_db'">
Active Directory: $String
<$active_dir = $String>
<$source_dir = $String>
<$dest_dir = $String>
</sql>
<strstri "db1" $active_dir>
<if $ret ne -1>
<sandr "db1" "dbtemp/*" $source_dir>
<$source_dir=$ret>
<sandr "db1" "db2" $dest_dir>
<$dest_dir=$ret>
<sandr "/db2" "" $dest_dir>
<$dest_dspace=$ret>
<else>
<sandr "db2" "dbtemp/*" $source_dir>
<$source_dir=$ret>
<sandr "db2" "db1" $dest_dir>
<$dest_dir=$ret>
<sandr "/db1" "" $dest_dir>
<$dest_dspace=$ret>
</if>
Source Directory: $source_dir
Destination Directory: $dest_dir
Destination Dataspace: $dest_dspace
<sum "%s" $dest_dir "/*">
<$deletepath=$ret>
<sysutil del glob $deletepath>
<$errstring=$ret>
<if $errstring eq "">
<sysutil copy glob $source_dir $dest_dir>
<$errstring=$ret>
<if $errstring eq "">
Flipping Switch...
<sql db=$testdb "update options set String=$dest_dir where Profile=$profiles and Name='SS_db'">
Directory String: $String
</sql>
<if $loop eq 0>
Error: Unable to switch the $profiles profile to $dest_dir.
<else>
Done: Switched the $profiles profile to $dest_dir.
</if>
<sql db=$testdb "update options set String=$dest_dspace where Profile=$profiles and Name='SS_dataspace'">
Dataspace String: $String
</sql>
<if $loop eq 0>
Error: Unable to switch the $profiles dataspace to $dest_dspace.
<else>
Done: Switched the $profiles dataspace to $dest_dspace.
</if>
<else>
Copy Failed - not flipping switch.
Error: $errstring
</if>
<else>
Delete of $deletepath failed.
Error: $errstring
</if>
=========================
</loop>
</A> <!-- end main -->
</SCRIPT>
Output from the program run: (Note: this doesn't change from one run to the next, so it's apparently not flipping the switch either.)
D:\ThunderstoneSoftware\Moen\Scripts>REM ===============================================
D:\ThunderstoneSoftware\Moen\Scripts>REM File: MoveAndGoLive.bat
D:\ThunderstoneSoftware\Moen\Scripts>REM Purporse: Copy New files from dbtest to
D:\ThunderstoneSoftware\Moen\Scripts>REM db2 or db1, and flip the active
D:\ThunderstoneSoftware\Moen\Scripts>REM db to the one just copied.
D:\ThunderstoneSoftware\Moen\Scripts>REM ===============================================
D:\ThunderstoneSoftware\Moen\Scripts>REM d:\wwwmoencom\cgi-bin\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"
D:\ThunderstoneSoftware\Moen\Scripts>d:\Thunderstonesoftware\webinator\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"
<!-- Texis RDBMS Copyright (c) 1992 - 2003 Thunderstone - EPI, Inc. -->
<!-- Texis Web Script Copyright (c) 1996 - 2003 Thunderstone - EPI, Inc. -->
Profile: Consumer
Active Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db1
Source Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/dbtest/*
Destination Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db2
Flipping Switch...
Profile: Builder
Active Directory: d:\thunderstonesoftware\webinator/texis/Builder/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Builder/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Builder/db1
Flipping Switch...
Profile: Designer
Active Directory: d:\thunderstonesoftware\webinator/texis/Designer/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Designer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Designer/db2
Flipping Switch...
Profile: Plumber
Active Directory: d:\thunderstonesoftware\webinator/texis/Plumber/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Plumber/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Plumber/db2
Flipping Switch...
Profile: Retailer
Active Directory: d:\thunderstonesoftware\webinator/texis/Retailer/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Retailer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Retailer/db1
Flipping Switch...
Profile: Remodeler
Active Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/db2
Flipping Switch...
Profile: Wholesaler
Active Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/db1
Flipping Switch...
Profile: MechanicalEngineer
Active Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db2
Flipping Switch...
<H6 ALIGN=right><A HREF="http://www.thunderstone.com/" TARGET="_top"><IMG SRC="/copy.gif" BORDER=0 WIDTH=304 HEIGHT=11 ALIGN=top ALT="Texis & Webinator Copyright (c) 2003 THUNDERSTONE - EPI, Inc."></A></H6>
copy the dbtemp files to the non-live directory, and
then flip the switch, making the other directory (with the new files) live.
It used to work fine. Now it doesn't. I'm wondering if this is another symptom of the newer version of Webinator, for which I mistakenly applied the vfpatch, when I shouldn't have.
But, I tested running with the copy of texis that's in the install directory, and it still doesn't work.
Here are the details:
Version of Texis in the install dir:
Texis Web Script (Vortex) Copyright (c) 1996-2003 Thunderstone - EPI, Inc.
Commercial Webinator Version 4.02.1046967833 of Mar 6, 2003 (i686-intel-winnt-32-32)
Version of Texis in the cgi-bin dir:
Texis Web Script (Vortex) Copyright (c) 1996-2002 Thunderstone - EPI, Inc.
Commercial Webinator Version 4.02.1031937844 of Sep 13, 2002
I tried both of those, with the same/similar results.
MoveAndGoLive.bat:
REM ===============================================
REM File: MoveAndGoLive.bat
REM Purpose: Copy New files from dbtest to
REM db2 or db1, and flip the active
REM db to the one just copied.
REM ===============================================
d:\thunderstonesoftware\webinator\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"
MoveAndGoLive (Vortex):
<SCRIPT LANGUAGE=vortex>
<TIMEOUT=-1></TIMEOUT>
<!--
--------------------------------------------------------------------
File: MoveAndGoLive
Purpose: Webinator DBs are rewalked on one machine, and then the
resulting updated DB files are copied to the production
machine, into a temporary directory. We have to clear
out the receiving directory, copy the files from the temp
directory to the receiving directory, and then flip the
switch from the old active directory to the new one.
History:
15-Jan-2003 jamon Changed Copyright for 2003
jamon Activated for all profiles
jamon Remove trailing / from dest_dspace
21-Oct-2002 jamon Added "glob" to the <sysutil delete...
jamon Added this file header.
16-Oct-2002 jamon New file
--------------------------------------------------------------------
(c) 2002-03 Moen Incorporated
All code is the property of Moen Incorporated
--------------------------------------------------------------------
-->
<A NAME=main public>
<vxinfo installdir>
<sum "%s" $ret "/texis/">
<$defaultdir=$ret>
<!-- For each primary profile: -->
<!-- Go get the current live directory (db1 or db2) -->
<!-- Set variables for source and destination for the copy -->
<!-- Do the copy -->
<!-- Flip the switch -->
<$testdbdir="TestDB">
<sum "%s" $defaultdir $testdbdir>
<$testdb=$ret>
<$profiles= "Consumer" "Builder" "Designer" "Plumber" "Retailer" "Remodeler" "Wholesaler" "MechanicalEngineer" >
<!-- $profiles= "Builder" -->
<loop $profiles>
Profile: $profiles
<sql db=$testdb "select String from options where Profile=$profiles and Name='SS_db'">
Active Directory: $String
<$active_dir = $String>
<$source_dir = $String>
<$dest_dir = $String>
</sql>
<strstri "db1" $active_dir>
<if $ret ne -1>
<sandr "db1" "dbtemp/*" $source_dir>
<$source_dir=$ret>
<sandr "db1" "db2" $dest_dir>
<$dest_dir=$ret>
<sandr "/db2" "" $dest_dir>
<$dest_dspace=$ret>
<else>
<sandr "db2" "dbtemp/*" $source_dir>
<$source_dir=$ret>
<sandr "db2" "db1" $dest_dir>
<$dest_dir=$ret>
<sandr "/db1" "" $dest_dir>
<$dest_dspace=$ret>
</if>
Source Directory: $source_dir
Destination Directory: $dest_dir
Destination Dataspace: $dest_dspace
<sum "%s" $dest_dir "/*">
<$deletepath=$ret>
<sysutil del glob $deletepath>
<$errstring=$ret>
<if $errstring eq "">
<sysutil copy glob $source_dir $dest_dir>
<$errstring=$ret>
<if $errstring eq "">
Flipping Switch...
<sql db=$testdb "update options set String=$dest_dir where Profile=$profiles and Name='SS_db'">
Directory String: $String
</sql>
<if $loop eq 0>
Error: Unable to switch the $profiles profile to $dest_dir.
<else>
Done: Switched the $profiles profile to $dest_dir.
</if>
<sql db=$testdb "update options set String=$dest_dspace where Profile=$profiles and Name='SS_dataspace'">
Dataspace String: $String
</sql>
<if $loop eq 0>
Error: Unable to switch the $profiles dataspace to $dest_dspace.
<else>
Done: Switched the $profiles dataspace to $dest_dspace.
</if>
<else>
Copy Failed - not flipping switch.
Error: $errstring
</if>
<else>
Delete of $deletepath failed.
Error: $errstring
</if>
=========================
</loop>
</A> <!-- end main -->
</SCRIPT>
Output from the program run: (Note: this doesn't change from one run to the next, so it's apparently not flipping the switch either.)
D:\ThunderstoneSoftware\Moen\Scripts>REM ===============================================
D:\ThunderstoneSoftware\Moen\Scripts>REM File: MoveAndGoLive.bat
D:\ThunderstoneSoftware\Moen\Scripts>REM Purporse: Copy New files from dbtest to
D:\ThunderstoneSoftware\Moen\Scripts>REM db2 or db1, and flip the active
D:\ThunderstoneSoftware\Moen\Scripts>REM db to the one just copied.
D:\ThunderstoneSoftware\Moen\Scripts>REM ===============================================
D:\ThunderstoneSoftware\Moen\Scripts>REM d:\wwwmoencom\cgi-bin\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"
D:\ThunderstoneSoftware\Moen\Scripts>d:\Thunderstonesoftware\webinator\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"
<!-- Texis RDBMS Copyright (c) 1992 - 2003 Thunderstone - EPI, Inc. -->
<!-- Texis Web Script Copyright (c) 1996 - 2003 Thunderstone - EPI, Inc. -->
Profile: Consumer
Active Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db1
Source Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/dbtest/*
Destination Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db2
Flipping Switch...
Profile: Builder
Active Directory: d:\thunderstonesoftware\webinator/texis/Builder/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Builder/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Builder/db1
Flipping Switch...
Profile: Designer
Active Directory: d:\thunderstonesoftware\webinator/texis/Designer/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Designer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Designer/db2
Flipping Switch...
Profile: Plumber
Active Directory: d:\thunderstonesoftware\webinator/texis/Plumber/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Plumber/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Plumber/db2
Flipping Switch...
Profile: Retailer
Active Directory: d:\thunderstonesoftware\webinator/texis/Retailer/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Retailer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Retailer/db1
Flipping Switch...
Profile: Remodeler
Active Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/db2
Flipping Switch...
Profile: Wholesaler
Active Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/db1
Flipping Switch...
Profile: MechanicalEngineer
Active Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db2
Flipping Switch...
<H6 ALIGN=right><A HREF="http://www.thunderstone.com/" TARGET="_top"><IMG SRC="/copy.gif" BORDER=0 WIDTH=304 HEIGHT=11 ALIGN=top ALT="Texis & Webinator Copyright (c) 2003 THUNDERSTONE - EPI, Inc."></A></H6>