How to copy VSS project from one VSS database to another one without loosing history

copy-vss-project-from-one-vss-database-to-another-one-without-loosing-history

If you have any of the following questions in your mind, then this article is the perfect destination for you.

  • How to copy VSS project from one VSS database to another one without loosing history
  • How to move VSS project from one location to another location
  • Moving Visual SourceSafe projects or databases to a new location?
  • Moving a project or projects from one database to another, while preserving the project’s history?

The procedures within each scenario may vary depending on the version of Visual SourceSafe you are running.

APPLIES TO

Microsoft Visual SourceSafe 5.0 Standard Edition

Microsoft Visual SourceSafe 6.0 Standard Edition

NOTE: This process is for Visual SourceSafe 5.0 or greater only.

Requirement:

1.   Use the SSARC and SSRESTOR utilities included in Visual SourceSafe 5.0. With these utilities, you can archive projects, preserve their histories, and restore them to a new database.

2.   You must have SourceSafe Admin privileges to use these utilities

3.   In order to restore a project successfully your archive must include the latest versions all the files in the project. If you use the -v switch with SSARC to archive off earlier versions of your files, you will not be able to restore that archive to a different database because it needs the later versions.

4.   Because the physical file names get renamed when you restore a project to a new database, it may be necessary to reconnect projects that are integrated with Visual SourceSafe.

Warning:

1.   always be very careful when archiving and deleting files

2.   Backing up source files is like voting, do it early and often (warning, this may not be legal in your jurisdiction).

3.   Test your backups out before you actually need them, avoid permanent deletes and keep copies in multiple locations.

 

There are two ways to Archive and Restore Project/Files from one database to another.

To Archive:

1.   Using To archive a database using Visual SourceSafe Administrator

2.   SSARC

Archival of a database allows you to:

* Save disk space on the Visual SourceSafe server or other machine hosting the database.
* Make the Show History command work more quickly.
* Transport files and projects between Visual SourceSafe databases, keeping history information intact.
* Provide a compressed file backing up all or part of a database.

How to Archive Visual SourceSafe (VSS) Project?

Method1: Using Visual SourceSafe Administrator:

The Visual SourceSafe Administrator program allows you to archive your databases using the Archive Projects command, and to restore them from backup using the Restore Projects command.

To archive a database using Visual SourceSafe Administrator:

1. Ensure that no one is using the database and that the ANALYZE utility will not run during the archive operation.
2. Open the database for which you want to archive information.
3. On the Archive menu of Visual SourceSafe Administrator, click Archive Projects.
4. In the Archive wizard, select the project(s) to archive, and click OK.
5. If there are additional projects to be archived, indicate this in step 1 of the wizard, and click Next when finished.
6. In step 2 of the wizard, specify how you want the project(s) to be archived, and click Next when finished. For each choice, you can use Browse to search for and select an archived file to overwrite the existing file.
7. In step 3 of the wizard, specify the versions for the data to archive, using the Version box.
8. Add a comment to the Comment box to document the archive operation.
9. Click Finish to complete the wizard. The archive is written to a *.ssa file in the directory that you have specified.

Method2: Using SSARC: –

Another way of making an archive is to use the Visual SourceSafe SSARC utility from the command line.
Examples

SSARC -d- -yadmin,password archive.ssa $/
Backup the entire default Sourcesafe database to archive.ssa, leaving the database exactly as it is.

SSARC -d- “-vlProduction Release” -yadmin,password -olog.txt archive.ssa $/Test

Backup everything since the version labelled ‘Production Release’ and create a log file with the results of the archiving process.

SSARC -d -x -yadmin,password archive.ssa “$/Project Global Domination” $/OtherProject

Description:  Archive, and delete the deleted files from two projects.

SSARC -i -yadmin,password -olog.txt “-cArchive Everything” archive.ssa $/

Description:  Archive the entire Sourcesafe database, while creating a log file, adding a comment, and running non-interactively, suitable for a scheduled task.
To Restore Project/Files from one database to another.

To Restore:

1.   Using To archive a database using Visual SourceSafe Administrator

2.   SSRESTOR

 

How to Restore Visual SourceSafe(VSS)Project?

Method 1: Using Visual SourceSafe Administrator

Visual SourceSafe Administrator supports restoration of a database from an archive using its Restore Projects command.

To restore a database using Visual SourceSafe Administrator

1. Make sure that no one is using the database and that the ANALYZE utility will not run during the restore operation.
2. On the Archive menu of Visual SourceSafe Administrator, click Restore Projects.
3. In the Restore wizard, enter or locate the archive file from which to restore, and then click Next.
4. In step 2 of the wizard, you can choose the items to restore to the database, and click Next to proceed.
5. Use step 3 of the wizard to specify options for restoring the selected items to the database.
6. Add a comment to the Comment box to document the restore operation.
7. Click Finish to complete the wizard.
8. Verify the database directories carefully to make sure that the restore operation has put the restored items where you intended.

Method 2: Using SSRESTOR Utility

Restores information from a previously created archive. If the restore operation attempts to create a duplicate file or project name, the operation fails. Visual SourcSafe also implements restore operations through its Restore wizard, available in Visual SourceSafe Administrator.
Examples

SSRESTOR -la -yadmin,password archive.ssa $/

Display a list of all of the files archived in archive.ssa.

SSRESTOR “-p$/Test 2” -sD:\newfolder\ -yadmin,password backup.ssa $/Test

Restores project $/Test to the database to a new location, $/Test 2, from the archive file backup.ssa, in a different Sourcesafe database.

Tagged : / / / / / / / / / / / / / / / / / / /

Considerations for Multiple VSS Databases – Pros and Cons

multiple-vss-databases

Microsoft recommends against using multiple VSS databases in simple cases. The support that was in some earlier versions of the product using Data Path doesn’t seem to work at all well in some cases. And at first it can seem that VSS isn’t even capable of operating with multiple databases. On the other hand, there are sometimes good reasons for using multiple VSS databases. And mechanisms for accessing multiple databases ­­sometimes better than the original Data Path mechanism­­ are available in every case (although often poorly documented).
Considerations for Multiple VSS Databases

Pro

  • Quicker maintenance (ANALYZE, backup, etc.) You can for example do detailed maintenance on a different database each day of the week rather than having to do the whole thing all at once.
  • Smaller granularity (In other words you can take a damaged part of VSS down without taking having to take the entire VSS system down.) The current “all or nothing” behavior of VSS is a real thorn in the side of many VSS administrators. In fact this shortcoming alone seems such a “scalability problem” that it makes VSS less than desirable for use in any organization larger than ten people. Multiple VSS databases mitigates this.
  • Perhaps slightly (but not significantly) better performance.
  • Slightly less risk of running into VSS bugs that tend to show up when VSS is stretched beyond its testing and its design center to handle a single very large database.
  • If you have to “restore” a whole database, you at least don’t lose all your organization’s recent work.

Con

  • Potentially a separate list of users for each database, with each user having a separate SS.INI for every database. (One of the configuration recommendations below negates both of these limitations, but maintenance will not be fully automatic. You definitely will have to “add” new users to each database separately, and you may also have to “just remember” to do a few additional manual steps whenever you add or change a VSS user.
  • Separate “user rights” for each database. (It’s very difficult to work around this limitation as the VSS tools for maintaining “user rights” are poor. In fact there’s not even a way to “dump” a “user rights” database to text so you can scan or manipulate it yourself with your own text editing tools.) You could easily wind up facing a maintenance nightmare. One of the configuration recommendations below negates this limitation by simply “not using” user rights at all. You should seriously consider the option of not using “project security”.
  • Microsoft support may blame some hard problems on the multiple databases and say “we told you so”, even if multiple databases really don’t have anything to do with the problem you’re asking them to help with.
  • You cannot “share” files between multiple VSS databases at all. All you can hope for is that your source can be divided into multiple VSS databases along fairly natural project boundaries in such a way that there is virtually no need to “share” files between the multiple databases.
  • It is difficult to bring your multiple databases into one centralized system. The configuration recommendation below of having one unified grand project hierarchy makes this easier. But you will still need to use the Archive and Restore utilities if you need to move a project from one database to another.

 

Tagged : / / / / / / / / / / / / / /