November 11, 2009
Works with Surround SCM 2010 and later
Will not work with Surround SCM 2009 and earlierSSCMigrate is a sample tool that copies a branch into a new mainline. It can be any branch, however, only that branch is migrated. Any child branch will not be migrated. This is a sample tool and it is not a finished product by any means. Depending on your needs, this may give you a good starting point. At this time only the following historic events are handled:
- AddToRepository - Historic event when a brand new file is added to a branch from disk. This event is mapped as an AddToRepository event on the new mainline.
- AddFromBranch - Historic event when a file is added to a branch as a result of a promote. This event is mapped as an AddToRepository event on the new mainline.
- CheckIn - Historic event when a file is modified as part of a check in. This event is mapped as a CheckIn event on the new mainline
- PromoteFromBranchWithMerge - Historic event when a file is modified as part of a promote that required a merge. This event is mapped as a CheckIn event on the new mainline
- PromoteFromBranchWithoutMerge - Historic event when a file is modified as part of a promote that did not require a merge. This event is mapped as a CheckIn event on the new mainline
Tech DetailsThis sample is written in C# using Visual Studio 2008. The entire project is provided for your perusal. To run this 'as-is', you must have a folder called migrate at the root of your C: drive. This is the working directory for this application to get files from the old branch and add them to the new one. To change this, edit the value assigned to the workDir variable.
Using the toolAt the time of this writing, creating a mainline branch is not possible with the API, so it must be created first manually. The tool itself takes all information as parameters, and they are as follows (in the correct order):
- Old (source) mainline
- Old (source) branch
- New mainline (created manually before running the tool)
- Surround SCM user name
- Surround SCM user password
- Surround SCM server address/name
- Surround SCM server port (default is 4900)
ExampleThe following example migrates the branch "Bug Reporter - Staging" in the "WysiCorp" mainline to a new mainline called "BugReporter".
SCMMigrate "WysiCorp" "Bug Reporter - Staging" "BugReporter" Administrator password localhost 4900The following example migrates the mainline "WysiCorp" to a new mainline called "BugReporter".
SCMMigrate "WysiCorp" "WysiCorp" "BugReporter" Administrator password localhost 4900
Known IssuesThe only known issues so far deal with the events that are not currently handled.
SecurityKeep in mind that the API does respect security, so any repositories not visible to the user will not be migrated. The user will have to be able to do the following (this may not be an all inclusive list):
- Access source branch and all repositories
- Access history on all files on source branch
- Get all historical versions of all files
- Add files to new mainline
- Check out files from new mainline
- Check in files to new mainline
- Any other security permission to handle any enhancements made to the tool, like handling shares.