Export Import Tool

Vault Folder Export/Import allows you to copy the contents of a Vault folder to a different server or a different repository on the same server.

Folder Export will output the contents and history of a selected Vault folder to a local file on the file system. That file is then used to import the folder contents to a different Vault repository or server.

User Interface

The Folder Export/Import user interface consists of a standalone application that is installed with either the Admin Tool or the GUI Client. The same interface is used for both the exporting and importing data.

How you invoke the Folder Export/Import tool depends on how it was installed.

If you installed it with the Admin Tool (or Vault Server) installer, a shortcut will exist at Start Menu->All Programs->SourceGear Vault->Vault Folder Export Import.

If you installed the Vault Client, it will exist in the Vault Client installation folder (usually c:\Program Files\Vault Client) as VaultFolderExportImport.exe.

Exporting a Folder

In order to export a folder to a file, take the following steps in the Folder Export Import user interface:

·      Connect to a Vault server and repository that you want to export from. Do this via the File menu, Connect to Server command. This is the usual process for logging into Vault, as you would do in the GUI client or Admin Tool. The Choose Repository dialog will be automatically displayed after a successful login to the server.

·      You can change the repository at any time by invoking File->Choose Repository or Ctrl-P.

·      After a successful login, the folder tree for the chosen repository is displayed in the main window. Choose the folder you want to export, and invoke the Export command (either view the toolbar button, the Action->Export menu item, the right mouse click context menu or Ctrl-E)

·      This will bring up a dialog that allows you to specify a file you want the data to be exported to.

·      The “Export Deleted Items” checkbox allows you to choose whether to export folders and files that have been deleted in the folder. If you do not export deleted items, they cannot be undeleted and retrieved when they are later imported.

·      The “Comment” text area allows you to store a description of the export in the data file, which will then be displayed later when the file is imported. This comment will not be put anywhere in the Vault database.

·      Press “Begin Export” to start exporting data to the data file. A progress bar will give a general indication of how much data has been exported.

The repository does not have to be locked during the export – other source control activities can be happening simultaneously with the export.

However, note that no transactions applied to the folder after the export begins will be included in the exported data. For instance, if you check in a new version of a file within the export folder after the export begins (but before it finishes), that new folder version will not be reflected in the data file, and therefore will not be part of an import taken from that data file.

Import

In order to import a folder to a new server or repository, take the following steps in the Folder Export Import user interface:

·      Copy the export file created during export to the machine where you will be doing the import.

·      Invoke the Vault Folder Export Import and connect to the server and repository you want to import the data.

·      Select the parent folder where you want the imported folder to be placed.

·      Invoke the Import command (either view the toolbar button, the Action->Import menu item, the right mouse click context menu or Ctrl-I)

·      The import dialog will be displayed, and has the following fields:

·      File Name. The path to the export file to be imported. You can select this file from the local file system using the button to the right of the text field.

·      Staging Folder: This is a temporary folder in Vault that is used to import all the data to before moving to its final location within Vault. A staging folder with a non-user-friendly name is used so that users won’t accidentally start apply source control transactions to the real folder before it is finished importing.

·      Import to Subfolder. This determines whether or not the top level folder being imported should be created in Vault. To see the effects of this value, see how the “Import To Folder” field changes when this is toggled.

·      Exported Folder. This is the Vault folder path that was previously exported, and is to be imported.

·      Import To Folder: This is the folder to place the imported folders and files in the Vault server and repository you are currently connected to. The “Import to Subfolder” checkbox determines whether the top level folder is to be created at this location or not.

·      Exported. This is the date/time the data was exported

·      Comment. This is the comment that was entered during the export process that would contain a description or other relevant information about the export.

·      Press the “Begin Import” button to begin the import. A progress bar will give a general indication of how much data has been imported.

As with export, an import can happen while other source control operations are taking place. However, import will have a greater performance impact on the Vault server than export will

Log File

A log file is created by default when running an export or import. If an export or import fails for any reason, the log file can be viewed for hints as to what failed, and also can be sent to SourceGear technical support for further diagnosis.

The log file is configured in the same way as other Vault client apps, with the use of a .config file located in the same folder as the executable. In this case, it is the VaultFolderExportImport.exe.config file that controls whether and how to output log information.

The config file allows you to turn logging on or off, specify an alternate location for the log file, and turn on additional logging classes to get more output. See the explanations within the log file for more information.

Limitations of Export/Import

Certain operations cannot be completely imported depending on where in the tree the export happens from. The limitations of Export/Import for each command are listed below

Branch

For items that have been branched, history is not exported for actions that happened before the branch, if it was branched from a location outside the export root.

So, for example, if $/foo/trunk was branched to $/foo/branch, and $/foo/branch was exported, only those changes that applied to $/foo/branch after the branched happened will be exported. If you want to include those history items, you would have to export at $/foo, to include both sides of the branch.

Also, for items that were branched from outside the export root, they are considered created in the import folder rather than branched.

With the example above, instead of reporting that $/foo/branch was branched from $/foo/trunk, it would report that $/foo/branch was simply created, since there is no $/foo/trunk in the import folder to reference.

Deleted Items

You have the choice when exporting of whether to included deleted items in the export. If you include deleted items, they can be undeleted or obliterated in the newly imported folder.

If you did not include deleted items, then will simply not exist in the imported folder. History will show that these files and folders existed, but you will not have access to them.

One note about deleted items is that if you applied a label in the exported folder that applied to a file or folder that is currently deleted, and the deleted items were not exported, those labels will not include the deleted items either.

Shares

If a file or folder is shared completely within the folder that is exported, all the shares links will be imported and shared as before.

However, if there are links in a share that are outside the root of the export, those links are not included in the share, and if all share links are out the export folder, then the file or folder is not shared at all in the imported folder.

For example, if $/example1 is exported, and $/example1/foo.txt is shared to one other place at $/example2/foo.txt, then the imported file foo.txt will not be shared after the import, because none of its share links exist within the imported folder.

Labels

Only labels that have been applied to the root export folder and below will be exported. Labels applied above the root export folder will not be included even though they do partially apply to the exported folder.

For example, say “Label1” were applied to $/src and “Label2” were applied to $/src/foo and “Label3” were applied to $/src/foo/sub.

If the export folder was $/src/foo, then Label2 and Label3 would be part of the import, but Label1 would not be.

Note that imported labels cannot contain items that have moved outside the export folder, nor deleted items that were chosen not be imported. If you need labels to contain these items, you will need to be sure to export at a high enough level to include all the items that were ever contained in that label.

Also, the current version will not export any promotions of exported labels. Promotions on any labels will need to be applied manually after the import. Label Promotion support will be added in a future release.

Move

Items that have been moved outside the export folder are treated as deleted items and are not imported.

For example, if $/src/foo was moved to $/old/foo, and the export is then done at $/src/foo, then neither foo nor anything under it actually exists after the import. Also, labels that included $/src/foo would not be able to retrieve those in the newly imported folder when doing a Get on that label. In order to workaround this, you would need to export at a high enough level in the tree to include all the places the moved files/folders currently exist at.

Items that were moved into the export folder work fine, but they are considered “created” in the import, not “moved”, since the location they moved from would not exist.

Items moved completely within the exported folder should work without any issues.

Pins

There are no limitations for pin. If a folder or file is pinned at the time of the export, it will be pinned in the import at the same version as well. All the pinned file or folder’s history will be included in the import, so that unpinning the item in the newly imported folder cause it to have the latest version that existed in the exported folder at the time of export.