BCP – Local path not found for file

The Vault BCP (bulk copy) is a quite cool tool in order to fill the Vault with all your data, files, properties, categories, links, items, BOMs, revision, etc. And all in the first version and extremely fast compared to using the API. The package created during the export contains a bunch of XML files, which describes the metadata, and an additional folder contains all the files. Now from here you can start adapting the XML files to your need in order to re-import the files in another Vault with the applied modifications. Or once you understood the logic behind the XML files, you could create your own application that generates such XMLs in order to populate the Vault the way you want. We use this technique for migrations from other systems to Vault, or for consolidating different Vaults down to one.

Of course with every technology you get good and bad. One nasty error message is for instance “Local path not found for file: xxxxxx.yyy”. This means that in your XML file, the path to the file (LocalPath=) for the given record is not correct. But what if it is correct? We experienced that as long the path is a local one, everything is fine. As soon you start dealing with network paths, it could become tricky. In our tests the BCP can cope with local path and UNC path, but not with mapped.

A simple test is to export the content of your Vault, could be even just few files, via BCP like this:

Vaultbcp.exe EXPORT c:\temp\bcp_test "<username>" "<password>" "<VaultName>"

Now under c:\temp\bcp_test you’ll find the XML files containing your metadata and a subfolder called bcp_test-files-0. Move this folder to another location of your local disk. For instance, move the folder to c:\temp\bcp_files. Now create a network share on this folder and check if you can access via UNC (\\<yourComputerName>\) and create also a network mapping like x:.

Manipulate the Vault.XML file, make a backup copy first, by replacing the string .\bcp_test-files-0\ with \\<yourComputerName\<yourShare>\, we can then try the import into a new Vault. Create your new test Vault, for instance bcp_test. Now we can try to import this package again:

Vaultbcp.exe IMPORT c:\temp\bcp_test "<username>" "<password>" "bcp_test"

This time the import should be fine. Now let’s try with a mapped folder, the x:. Replace again your current string with x:\. Delete your imported test Vault and recreate the Vault with the same name, in our case bcp_test. Now let’s try again the import:

Vaultbcp.exe IMPORT c:\temp\bcp_test "<username>" "<password>" "bcp_test"

You will notice that you’ll get lots of “Local path not found for file”. We checked the code and cannot really understand where this is coming from. Anyway, if your files are local and the path points to a local path, then it should work fine. In case, like us, you create an application that creates such BCP package using data from a different source, like an old PDM, ERP, or similar, then you may end up having a mix of local path, UNC and mapped paths, and the according error message while importing. The weird thing here is that the path you use exists and files are there, so you may spend time figuring out the problem. Don’t waste your time. Ensure the files are local, and then it works.

In our application (documentAnalyzer) we prepared some switches in order to run collect the files on local, UNC or mapped drives, but when we finalize the XML file, we replace the paths with a custom local path.

If you like to read more about the BCP tool, just leave a comment and we can share more information and experiences.

This entry was posted in Vault API. Bookmark the permalink.

One Response to BCP – Local path not found for file

  1. Pingback: New version of bcpChecker available | coolorange

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s