New cgi install

Pretend I have a WE cgi running in server folder ‘myWEApp’ and Application Identifier ‘com.xojo.myWEApp01’ with users attached.

If i rename the server folder to ‘myWEAppOld’ will this kill off all the currently connected users, or will then still be able to run since the Application Identifier remains the same?

If all is OK, can I then install a newer version into the now vacated name of ‘myWEApp’ and a new Application Identifier of ‘com.xojo.myWEApp02’, so new users will run the later cgi while older users will continue on the old cgi until they all quit/time out? After 24 hours I will probably delete the ‘myWEAppOld’ folder.

Will this work?

For me, as a design, it’s an incorrect approach. For a myWebApp app, it should be com.xojo.myWebApp all the way. Your release version is just another property.

Probably you should install your v2 in another folder, and make new users to go there while old users are going to the v1 folder for a while.

I would ideally like the users to move over, but my database is used by people world-wide, I cannot get them to move automatically and I don’t want them to be cut-off all of a sudden.

I want a technique where new users will connect to the new cgi and old users will remain on the old cgi.

There are two questions I am asking: will renaming the cgi’s folder kill the users, and can two versions of the same cgi run on the same server as long as they are in different folders and have a different Application Identifier?

Well, what I just can offer is to say what I usually do for other kind of apps (not Xojo):

http://www.myapp.com -> redirect www.myapp.com/appv1

Then I develop the v2 and publish under /appv2 and change the redirect, so new visitors get this:

http://www.myapp.com -> redirect www.myapp.com/appv2

Once they left v1 and return they will be migrated to v2. May take some days.
You should alert them that the v1 will be disabled after date x/x/2013 and that they need to move to new version.

You should not rename/delete content of a running app or you put your users in the risk of a crash.

As for the exact consequences of your questions I’ll let those for experienced users or Xojo team to answer.

@Rick A. your renaming of folders and pushing new users to the latest version is good and this gets around my bad practice of renaming folders with live users in them. But the issue remains that two WE apps cannot run, even in different folders, with the same Application Identifier, so you might plan to give www.myapp.com/appv1 the Application Identifier ‘com.myapp.myappv1’.

[quote=19451:@David Cox]If i rename the server folder to ‘myWEAppOld’ will this kill off all the currently connected users, or will then still be able to run since the Application Identifier remains the same?
[/quote]

In a CGI deployment, that will kill them off, as the connected users rely on the path to your CGI to maintain their sessions. Additionally, if you rely on redirects, you’ll have the same problem. A session on the old version will suddenly be talking to the new version. Session won’t be valid, user will be kicked off.

App ID needs to be different for different CGI deployments or the CGIs will get confused.

One way you could address this is to use a landing page with a frame containing your app. A user on version 1, would load the landing page, which would load the old app inside. That user would stay on the old app so long as he doesn’t navigate off the landing page. You update the landing page to embed the new app. Subsequent users would get that.

Let me summarise the best process here:

myApp Version 1 is complete with Application Identifier ‘com.myapp.myapp01’ , so we:
• copy it to a folder on the server at ‘myApp01/myApp.cgi’
• test to ensure it works
• point our HTML landing page to ‘myApp01/myApp.cgi’
• lots of users are now running this cgi

myApp Version 2 is completed with the new Application Identifier ‘com.myapp.myapp02’ , so we:
• copy it to a folder on the server at ‘myApp02/myApp.cgi’
• test to ensure it works without affecting the Version 1 users
• point our HTML landing page to the new ‘myApp02/myApp.cgi’
• lots of users are now running both Version 1 and Version 2, but new users are only running Version 2.
• A couple of days later you can check to see if the Version 1 cgi process is still running on the server i.e. has the last user timed out. If so, you may choose to delete the Version 1 cgi.

…Repeat…

I don’t think you’re gonna improve that process much with CGIs involved. Might be a marginally easier with stand-alone since you can launch apps with same app id on different ports.