Help need to setup regular copy of a Project from one DOORs Db to another

Hi ,
I need some help - I am relatively new to DXL programming.

We have 2 DOORS system in different countries (on a WAN). Access from our local site to the remote DOORS system is too slow for the Engineers to use. So I need to get one specific project copied from the remote server to a READ-ONLY copy on the local server on a weekly basis.

I assume that we need to archive the project on the remote server, copy the archive to a local location and then un-archive it to the local server. If someone has a better way of doing this then please tell me!

I am hoping someone has some basic DXL scripts to do the archive and the restore. I also need to know how I can schedule these to happen at specific times? I presume this will need to happen from the Windows Scheduler.? Yes - I am stuck running Windows servers ( company policy)

The local users are different to the overseas ones and can be put into a specific group so we only have to set that group to read only on the project.
SystemAdmin - Sun Oct 09 23:44:37 EDT 2011

Re: Help need to setup regular copy of a Project from one DOORs Db to another
llandale - Mon Oct 10 12:55:28 EDT 2011

You should be able to write a simple DXL script that performs the archive. That may look like this:

void  DoArchive(string NameProject, NameFolder)
{  string ErrMess = archive (NameProjBase, NameFolder "/" NameProject, false)
   if (!null ErrMess) print "error archiving '" NameProject "'  '" NameFile "': " ErrMess)
}
string NameTargetFolder = "c:/MyArchives/Archives_2011-Oct-10"
mkdir(NameTargetFolder)
current = folder("/")   // make sure DB root is current
 
DoArchive("MyProject1", NameTargetFolder)
DoArchive("MyProject2", NameTargetFolder)
DoArchive("MyProject3", NameTargetFolder)


That will fail when some bozo fails to log out of doors and therefore is in a project, or has a module open. Perhaps add deleting all locks...

Once that works, you should be able to deploy that with windows scheduler, but will need to insert the user name and password. That command may look like this:
"c:\Program Files\Rational\IBM\DOORS\9.3\bin\doors.exe" -u Administrator -P "SecretPassword" -b "c:/MyArchives/DoTheArchives.dxl"

I actually put that into a batch file, in a folder to which I only have access; otherwise you give out the admin password to anybody who can read the schedule.

 

 

  • Louie


You could also write a "defer" function that goes to sleep_ for say 10 minutes in a loop, waiting until its between 12:01am and 12:30am, and when it detects that then proceed with the archive. You would invoke that script before you go home and let it run all night.

You might also want to consider a Citrix solution and have just one database. Or use DWA so folks can use their browser to look at that other project.

 

 

Re: Help need to setup regular copy of a Project from one DOORs Db to another
OurGuest - Mon Oct 10 14:01:46 EDT 2011

You probably would get better results if you use citrix or microsoft windows server.

Re: Help need to setup regular copy of a Project from one DOORs Db to another
SystemAdmin - Sun Oct 16 23:25:23 EDT 2011

OurGuest - Mon Oct 10 14:01:46 EDT 2011
You probably would get better results if you use citrix or microsoft windows server.

Hi all,
Thanks for the help I will give it a go.

The two DOORs systems are very remote to each other and the network is not the fastest between us. Add the slow network to the latency and working across it is impossible. Citirx is set up at the other end but its still too slow to be workable over our network.

I have been trying to convince the other side to get DWA licences but they won't do it. We have them here and they work fine now I have got it setup as a service.

Thanks
Janet

Re: Help need to setup regular copy of a Project from one DOORs Db to another
llandale - Mon Oct 17 17:55:31 EDT 2011

SystemAdmin - Sun Oct 16 23:25:23 EDT 2011
Hi all,
Thanks for the help I will give it a go.

The two DOORs systems are very remote to each other and the network is not the fastest between us. Add the slow network to the latency and working across it is impossible. Citirx is set up at the other end but its still too slow to be workable over our network.

I have been trying to convince the other side to get DWA licences but they won't do it. We have them here and they work fine now I have got it setup as a service.

Thanks
Janet

Citrix should not be too slow so long as the Citrix server is close to the DOORS server. Instead of lots of module data transfering from you to the remote server, only screen shot updates and keyboard and mouse movements go. Years ago I crudely estimated that to be about 1/6th the traffic, but surely its far better when there are lots of linkagas and many modules are opened invisibly; and vastly faster when running report scripts taht don't open modules visibly.

Re: Help need to setup regular copy of a Project from one DOORs Db to another
ChrisAnnal - Tue Oct 25 09:58:31 EDT 2011

Here is a script I wrote to automatically do the following:

  • Check for locks on modules BEFORE attempting to archive a project
  • Skip over a project (instead of halting with a "Locked Module" message)
  • Send an email to the user when the task is completed - showing which projects were archived

This is the script...

//Archive Projects - CheckLocks
/*
Archive projects, after first checking to make sure they aren't locked - email results 
NOTE: Replace email address and email server (Lines 12 & 13 below) with your actual address and server 
*/
 
//Created 09/07/2011 - Saab Sensis Corp - C. Annal
/*******************************************************************************
 * Global constants
 */
              
const     string        targetAddress = "put your email address here"
const   string  emailServer = "put your email server here"
const   string  emailAccount = "DOORS"
const   string  fromDescription = "DOORS"
const   string  subject = "Archive Results"
 
/*******************************************************************************
 * Global Variables
 */
Lock lockItem 
LockList lcklist
string sProjectName 
string message  = ""
Project pX 
Buffer bx1=create, bx2=create
 
/*******************************************************************************
 * Function Declarations
 */
bool bLockedByAnyUser=true, bLocked
 
/*******************************************************************************
 * Script
 */ 
 
for pX in database do {  
sProjectName = name pX   
Project parent = getParentProject(pX)
if(null parent && !isDeleted pX){
   lcklist = getLocksInFolder(pX,true,bLockedByAnyUser) 
   bLocked=false
for lockItem in lcklist do {
   bLocked=true; 
   string lckuser = lockItem.user
   bx1+=sProjectName " locked by " lckuser "\n";
   break
}// End for lockItem in lcklist do
   if(bLocked)continue
   bx2+= sProjectName " was processed \n"
   string proj_archive = archive (sProjectName,"c:\\DOORS_Projects\\"(sProjectName)".dpa",false,true,allBaselines,false)    
if (!null proj_archive) 
        {
                ack proj_archive
                halt
        }// End !null proj_archive
}// End if(null parent && !isDeleted pX)
}// End for pX in database do 
message = bx1 "\n" bx2""
sendEMailNotification(
        fromDescription,
        targetAddress,
        subject,
        message)
//halt

 


This can be modified to only archive a specific, named project, if that's what you want. Let me know how this works for you. You can set up a batch process to run this. Below is an example. (Replace "username" with your name and <password> with the password you use to open DOORS). Obviously, you'd want to run this on a secure PC.

(Set up a task in Windows to "run" the following...)
start C:\"Program Files\IBM\Rational\DOORS\9.3\bin\doors.exe" -batch Archive_Checklocks.dxl -user username -password <password> -l C:"\DOORS Scripts\dxlerrors.log" -W

This will send any error messages to a log, if there are any - versus popping up an error message that you'd have to acknowledge in order to continue.
Chris Annal
DOORS Database Administrator / SW Test Engineer
Saab Sensis Corporation, East Syracuse, New York
chrisa@saabsensis.com