Cancel
Showing results for 
Search instead for 
Did you mean: 

Relocate files to another volume

Siemens Creator Siemens Creator
Siemens Creator

I need to relocate a number of files from one volume to another. The files that need to be moved aren't based on size or date. They are references from datasets in a particular BOM.

 

Wondering if anyone has done this and can recommend the best way to go about it.

 

Thanks, in advance, for any suggestions.

7 REPLIES 7

Re: Relocate files to another volume

Siemens Legend Siemens Legend
Siemens Legend
I don't know if it fits your usecase - but usually we move files from one volume to another with the move_volume_files utility:
https://docs.plm.automation.siemens.com/tdoc/tc/12.1/help#uid:move_volume_files

Re: Relocate files to another volume

Siemens Creator Siemens Creator
Siemens Creator

Thanks, Markus.

 

That certainly seems a good way to move the files.  From the docs, however, it seems that it requires criteria based on age and size.

 

Alternatively, it can accept a file with a list of filenames.  That appears to be list of "named references", files in the source volume. Do you know of a way that I can generate such a list?  Possibly with a query or a report?  I need to relocate all of the files referenced by a particular BOM.

 

Again, any suggestions are appreciated.

Re: Relocate files to another volume

Siemens Legend Siemens Legend
Siemens Legend
the simplest way would be using the f=move -srvcol=vol1 -destvol=vol2 switches - all the others are optional.
somehow you'd need to find out how to create a file for the -presorted_file switch...
maybe doing some ITK programming after you found out how such a files needs to look like.
I am not the expert, but I guess with queries it will be a difficult task.

Re: Relocate files to another volume

Gears Phenom Gears Phenom
Gears Phenom

Good afternoon, I think you can try to solve this problem using the preference IMF_display_full_path and the utility move_volume_files, as written by @MarkusK 

 

1) Get the list of files:
move_volume_files -u=user -p=password -g=group -f=list -outputfile=c:\list.txt -srcvol=volume1 -destvol=volume2

 

2) Use the preference IMF_display_full_path to get the necessary file names. Мore detail about this preference you can read in this thread:
https://community.plm.automation.siemens.com/t5/Teamcenter-Users-Forum/Get-File-Location-in-Teamcent...

 

3) Edit the list.txt file. Leave in it only the necessary file names.

 

4) Move the files:
move_volume_files -u=user -p=password -g=group -f=move -presorted_file=C:\list.txt -srcvol=volume1 -destvol=volume2

Re: Relocate files to another volume

Siemens Creator Siemens Creator
Siemens Creator

I understand what you are saying.  There are, however, more than 50,000 files in the volume and I only need to move 2.000 of them.  I'm trying to learn how to generate a list of those 2,000 files.

Re: Relocate files to another volume

Solution Partner Esteemed Contributor Solution Partner Esteemed Contributor
Solution Partner Esteemed Contributor
@TheOldGuy, There is no easy solution to your problem and the most likely solution is codeful. A BOM contains Item Revisions and each IR can have multiple Datasets. Targeting just the Datasets you are interested in is only part of the problem since a Dataset is a container that can hold multiple files. Pretty sure you'll need to write ITK for that kind of logic.

So you can spend your time writing ITK as @MarkusK suggests or you can spend your time opening/capturing each Dataset file path/name as @ArthurRM suggests. Both are valid suggestions. Either way it will take time to build the file list to pass to move_volume_files. Choose your poison.

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4

Highlighted

Re: Relocate files to another volume

Siemens Phenom Siemens Phenom
Siemens Phenom

Depending on your exact use case you might be able to get away with plmxml or tcxml export to get the file list (or at least get enough information to filter the list from move_volume_files).

 

If you perform a plmxml export of your structure using the out of the box ConfiguredDataExportDefault then you will get the Dataset(s) and the associated files (as ExternalFile elements).  By default the property set doesn't contain enough information for the files.  You would need to create a new Transfer Mode, use the existing Closure Rule, and add a Property Set that adds ImanFile sd_path_name, and file_name properties.

 

You should then be able to use the information in the PLMXML to filter the list from move_volume_files.

Still a bit of work, but no ITK.

 

This would give you the names of the files associated with the datasets that are in the configured version of the structure.  I think it would also give you the files that are configured in-context attachments (for example DirectModel JT files representing deformed parts in an NX assembly).

 

If you want the files from the datasets for all revisions of the parts involved in the assembly then you should still be able to do this, but you will need to modify the closure rule to go from ItemRevision up to Item, then back to all the ItemRevisions.  Getting the in-context attachments that cover all revisions of all the parts would be more complex.

You may need to use tcxml instead of plmxml as this can process its way through the MEAppearancePathRoot and MEAppearancePathNodes to find the attachments.

 

As @RandyEllsworth says there isn't necessarily an easy solution, particularly if you have in-context attachments you need to move, but depending on your use case you may be able to get a long way with the export tools before you need to reach for the compiler.