Documentation

Support

Unity Version Control

Archive revisions

Archive revisions, and access and restore archived revisions.
Read time 2 minutesLast updated 21 days ago

Set up a separate disk device and store large revisions there so they don't take up unnecessary space in the database. Some files, such as third-party compiled tools, programs, binaries, and other large files, rarely change and you rarely access them in a production environment. It costs disk space and time to store and retrieve these revisions from the database, so you can archive these files instead. Then, when you need to access those revisions, Unity Version Control (UVCS) searches for them in the external storage to retrieve them.

Archive a revision

To archive a revision, use the
cm archive
command, for example:
cm archive C:\mybigfile.tar#br:/main#0 -c="big file of libraries" -f="/home/plastic/bigfileTARrev0"
  • The command archives revision 0 of the main branch of the
    mybigfile.tar
    item. It creates several chunks of the revision, each one of which contains a part of the revision content.
  • UVCS creates the archive files in
    /home/plastic/bigfileTARrev0
    .
  • The
    -f
    parameter is a prefix for the archive files that you can use as a destination path for the archives. If you omit the
    -f
    switch, UVCS creates the archived files in the current directory.
To archive several revisions, specify them one after the other in the same command. For more information, use the
cm archive --help
command.

Access archived revisions

To access data stored in an external location, you need to create an
externaldata.conf
file. This file contains a path per line, with each path as the locations of the stored revisions. The following is an example of an
externaldata.conf
file:
E:\archivesOfRepository1D:\mybigfiles\revisionsOfBigFileTARF:\revisionsOfThe2_9Release
There are two locations that you can create the
externaldata.conf
file:
  • If you place the configuration file in the UVCS server location, you allow every user to automatically access those revisions as long as the external storage area is available.
  • If you place the configuration file in the UVCS client folder or in the user local directory, you can supply the archived contents to users individually and they can configure
    externaldata.conf
    on the client side.

Configuration file in the GUI

If a user tries to access any stored revision from the GUI and there is no
externaldata.conf
, a dialog appears to ask for the location of the data. After you identify the first chunk of the revision, UVCS can find the other chunks of the revision. UVCS can then create an
externaldata.conf
file in the local user directory, and from that moment on, UVCS tries to access the archived revisions from that location. If UVCS can't access the data at a certain point in time, it shows the same dialog again. If you identify a new location, UVCS adds this location to the existing
externaldata.conf
file.

Configuration file in the CLI

From the CLI (command-line interface) an externaldata.conf needs to always be available. If not, the command line asks you for an
externaldata.conf
to look for the revisions.

Restore archived revisions

You can use the command line to restore archived revisions back into the database, so you can safely delete the archives. Then, UVCS returns to using the database to retrieve the data. To restore archived revisions, use the
--restore
command, for example:
cm archive C:\mybigfile.tar#br:/main#0 --restore
The example restores revision
0
of the main branch of the file
mybigfile.tar
into the database. UVCS no longer uses the archives of that revision.