It's all about the answers!

Ask a question

copyWorkspace() across servers.??


sam detweiler (12.5k6195201) | asked Jan 15 '14, 10:57 a.m.
 In my project cloning utility I need to copy the workspaces from server A project X to server B project Y.

I have the streams and components. build engines and build defs. 

I think I want to use 

   server_B_wkspcmgr.copyWorkspace(server_B_relative_owner, server_a_workspace_connnection, etc);

I don't see any restrictions about copy across server.. is this distributed SCM? if so, then I have to enable on both servers to make this work.. 

did I get that right?

Accepted answer


permanent link
Ralph Schoon (63.2k33646) | answered Jan 15 '14, 11:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Sam,

yes, this is distributed SCM. You need to enable both server, and also enable the user you use to replicate change sets. You would basically pull the data from a stream into a repository workspace on the new server and then deliver that to the new stream there. That replicates all the involved change sets from the one server to the other.See https://jazz.net/library/article/535 . Please be aware, the work item links on the change sets will still point to the old repository.

I would suggest to rather have people to deliver all their open work into a stream and then only ship the data contained in the streams over.

I can provide you with a little bit more information, If you send me an e-mail.
sam detweiler selected this answer as the correct answer

Comments
sam detweiler commented Jan 15 '14, 11:39 a.m.

 thanks.. the servers are enabled for DSCM, 

the streams are duplicated already. the user doing the work is authorized for replicate change sets. 

unfortunately there are a number of workspaces that builds run from that didn't get created, so builds will fail,. 

I do not know the state of those workspaces relative to the streams, so can't depend on the stream to source them. 
want to copy 'as is'.

we are fixing up the links in workitems (and workitem comments) to correct to the new server data.
(see my question relative to comparing references to determine if an attachment already exists)

I don't know if I have you email on the system I am on. 


sam detweiler commented Jan 15 '14, 11:40 a.m.

 as an admin user, can I see ALL workspaces? (not contents, but their existance?)


sam detweiler commented Jan 15 '14, 11:45 a.m.

Hm.. got a socket timeout on the first copy.. 


I don't see a configuration for this in the CCM Advanced config for DSCM.
my projects are already set to 9999, but the data doesn't pass thru the client. 
(this is 3.0.1 to 3.0.1 copy) 

One other answer



permanent link
sam detweiler (12.5k6195201) | answered Jan 15 '14, 2:06 p.m.
 so another issue

I get all the users in this project, then loop thru all their workspaces and copy to the new server

user not found in target system =brownms
processing for workspace name=msb.toolkit.workspace.palace
Jan 15, 2014 1:49:18 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (org.apache.commons.httpclient.NoHttpResponseException) caught when processing request: The server xxjazu08.xx.com failed to respond
Jan 15, 2014 1:49:18 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Jan 15, 2014 1:50:18 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (org.apache.commons.httpclient.NoHttpResponseException) caught when processing request: The server xxjazu08.xx.com failed to respond
Jan 15, 2014 1:50:18 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request

            // loop thru the users in this project
            for (IContributorHandle owner : owning_project.getMembers())
            {
                try
                {
                    // need their name, so load whole record
                    IContributor prodwkspace_owner = (IContributor) prodauditableClient.fetchCurrentAuditable(owner,
                            ItemProfile.createFullProfile(IContributor.ITEM_TYPE), null);
                    // say we want workspaces
                    isc.setKind(IWorkspaceSearchCriteria.WORKSPACES);
                    // for THIS user
                    isc.setExactOwnerName(prodwkspace_owner.getName());
                    // loop thru all their workspaces
                    for (IWorkspaceHandle iwsh1 : (List<IWorkspaceHandle>) prodmgr.findWorkspaces(isc, 2000, null))
                    {
                        IWorkspaceConnection prodworkspace = prodmgr.getWorkspaceConnection(iwsh1, null);

                        if (!prodworkspace.isStream()
                        // &&
                        // prodworkspace.getProcessArea(null).sameItemId(owning_project.getProjectArea()))
                        )
                        {
                            System.out.println("processing for workspace name=" + prodworkspace.getName());
                            // IContributor prodwkspace_owner = (IContributor)
                            // prodauditableClient.fetchCurrentAuditable(prodworkspace.getOwner(),
                            // ItemProfile.createFullProfile(IContributor.ITEM_TYPE),
                            // null);
                            IContributor devowner = null;
                            try
                            {
                                if ((devowner = icm.fetchContributorByUserId(prodwkspace_owner.getUserId(), null)) != null)
                                {

                                    IWorkspaceConnection devworkspace = devmgr.copyWorkspace(devowner, prodworkspace,
                                            prodworkspace.getName(), prodworkspace.getDescription(), null);




Comments
Ralph Schoon commented Jan 16 '14, 2:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Sam,

I tried something similar and I had to look up the users in the destination using the ID and resolve them. I managed two separate ITeamRepository objects and connections and this worked for me.


sam detweiler commented Jan 16 '14, 5:23 a.m.

thanks.. thats what I do as well.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.