search cancel

Bulk download of all versions of one file

book

Article ID: 215082

calendar_today

Updated On:

Products

CA Harvest Software Change Manager

Issue/Introduction

If I have a file that is on version 10, is there a way to download versions 5 through 10 all at once, or do I have to download them one at a time and rename them as I go? I know you can download multiple versions, but that is if the have different filenames. What if it is the same item/filename, just different versions? It would be a nice to have if the files downloaded with either the version number in the name, or just (1) to denote copies of a file.

Environment

Release : 13.0

Component : RAPID IMPLEMENTATION MANAGER

Resolution

The difficulty is that all those versions are stored in the database under the same name. So, Harvest is designed to check them out one at a time.  Checking out multiple versions at the same time would only overlay one version of the file with the next one checked out.

What you could do is set up a batch script to loop through, use “hco” to check out each version and then rename the file to contain the version number.  Here’s a very quick example:

set _filename=README.TXT

for /l %%a in (5,1,10) do (
  echo %_filename%%%a
  hco %_filename% -b win2k12r2 -en SampleProject -st Development -vp "\SampleRepository\DOCS" -cp "C:\Temp" -br -vn %%a -replace all -op pc -usr harvest -pw harvest
  rename C:\Temp\%_filename% %_filename%%%a
)