VSS Replication/Synchronization
Hello,
We have problem: VSS (VSS 6.0) Database is hosted at customer server. Developers team uses SourceOffSite and VPN to get code from this VSS database. The project is big and team is not small. The process of getting last version takes too much time (at least 10 min, often - 30 min). If several people try to take last version simultaneously it can take an hour or more.
We'd like to get local version of VSS database with project. How can we organize synchronization between two VSS databases with correct merging of changes (something like MS SQL database replication). Does anybody know any tool for this? May be VSS 2005 can do it?
Hi,
VSS is probably not the best tool for distributed database/synchronization.
You can do what you want with VSS, but it may be a bit awkward if you want to avoid dealing with merging the same changes multiple times. You have to avoid letting VSS overwrite the vssver.scc/vssver2.scc files from different databases (which means don't get files from different databases in the same folder).
Here is how I'd do it:
Assume the project to be shared is \\server\vss_main, $/Project and the VSS user is alinc.
I'd create a local database C:\VSS with 2 users, 'Others' and 'Me'.
I'd get recursively all the project files from \\server\vss_main, $/Project
into C:\Project\Others.Main and I'd check them out using 'alinc' account.
I'd copy all the files from C:\Project\Others.Main into C:\Project\Others.Local
I'd add the files from C:\Project\Others.Local into C:\VSS database in $/Project.
I'd use VS.NET with 'Me' account to open the solution from source control in a different location, say into C:\Project\Me.Local.
Now you can continue working on your solution using 'Me' account, in C:\Project\Me.Local bound to the local database. You can checkout/checkin here as often as you like.
When you decide to publish your changes into remote VSS database (local--> remote), login with SSExplorer into C:\VSS database using 'Others' account, and get the files recursively into C:\Project\Others.Local; checkout the files here. Using xcopy/robocopy, copy recursively the C:\Project\Others.Local into C:\Project\Others.Main, excluding the vssver.scc/vssver2.scc files. Then use 'alinc' remote account and login into \\server\vss_main database, checkin the files from C:\Project\Others.Main.
You'll probably need to merge at this time with others' changes. *** After all is checked in, get recursively the files in C:\Project\Others.Main and check them out again. Using xcopy/robocopy, copy recursively the C:\Project\Others.Main into C:\Project\Others.Local, excluding the vssver.scc/vssver2.scc files.
Login now into C:\VSS using 'Others' account, checkin the files from C:\Project\Others.Local.
Back in VisualStudio, you can now get other's changes into your working enlistment by doing a Get on the solution.
If you just need to synchronize with others' changes (remote-->local), you just need to do the actions starting with ***. You may need to merge in that case during the Get into the local enlistment.
Copying the files from one folder into another without copying the vssver.scc files can be done by using:
- xcopy.exe with /-Y and /EXCLUDE parameters. If you have VSS2005, as the vssver2.scc the /EXCLUDE parameter is not required as vssver2.scc files are hidden). E.g.:
echo vssver.scc > C:\temp\excludelist.txt
xcopy C:\Project\Others.Main C:\Project\Others.Local /S /-Y /EXCLUDE:C:\temp\excludelist.txt
- robocopy.exe from NT resource kit. E.g.:
robocopy C:\Project\Others.Main C:\Project\Others.Local /S /X vssver*.*
Alin
If I remember correctly the problem and the proposed solution:
- the customer had a "Main" VSS database in a central location (\\server\vss_main) to which the access was slow.
- the intent was to work on local copies of VSS databases, and the problem was to synchronize these databases with the 'Main' database
- let's assume that your local VSS databse is 'Local', e.g. at C:\VSS
- let's assume you have a project in this database at $/Project
With these,
C:\project\Others.Main is an enlistment in the 'Main' database (open from source control the $/Project from 'Main' database)
C:\project\Others.Local and C:\project\Me.Local are two enslitments in the $/Project from the 'Local' database (open from sourcecontrol the $/Project from the 'Local' databse, once in C:\project\Others.Local and the second time in C:\project\Me.Local).
You'll be working on the enlistment from C:\project\Me.Local
The enlistment from C:\project\Others.Main is used to get other people changes from the main database
The enlistment from C:\project\Others.Local will be used to merge other people's changes (after getting them from main), with the changes in the local database and checkin/update the local database. (this enlistment is basically used as a buffer)
Alin