NIH | National Cancer Institute | NCI Wiki  

Error rendering macro 'rw-search'

null

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 28 Next »

If your user account has the Write or Own permission level on an existing collection in DME, you can move one or more data files or collections to that existing collection in the following ways:

  • If that existing collection has been configured to contain another collection, you can move a collection to it. 
  • If that existing collection has been configured to contain data files, you can move a file to it.

You can also rename a collection or file. 

To move or rename one or more collections or files:

  1. In your file system, create a JSON file that specifies a list of source and destination locations, as follows:

    {
     "moveRequests": [
      {
       "sourcePath": <full path in DME to the file/collection to be moved>
       "destinationPath": <full path in DME to the new file/collection>
      },
      {
       "sourcePath": <full path in DME to the file/collection to be moved>
       "destinationPath": <full path in DME to the new file/collection>
      }
     ]
    }
  2. Make sure that each sourcePath and destinationPath pair in the JSON file meets the following criteria:
    • In the value of your destinationPath, the last part (collection name or data file name) is new.

    • In the value of your destinationPath, the parent collection already exists.

    • Change only one part of the destinationPath at a time, in order from parent to child.

  3. Run the following command:

    dm_rename <move-description.json> [rename-status-file] [REST-response]

    The following table describes each parameter:

    ParameterDescription
    <move-description.json>A path to the JSON file containing the source and destination locations.
    [rename-status-file]An optional path and filename in your file system. If you specify this parameter, the system creates the specified file in the specified location and saves the status of the move or rename operation (the response from the server) in that file.
    [REST-response]
    An optional path and filename in your file system. If you specify this parameter, the system creates the specified file in the specified location and saves the response header (response from the server) in that file.

For example, consider the following command:

dm_rename /cygdrive/c/Users/JaneDoe/my-move-list.json

With the following code in the my-move-list.json file, the command moves and renames a collection and a file:

{
  "moveRequests": [
   {
     "sourcePath": "/Example_Archive/PI_Lab1/Project_Orig",
     "destinationPath": "/Example_Archive/PI_Lab2/Project_New"
   },
   {
     "sourcePath": "/Example_Archive/PI_Lab2/Project_New/File_Orig",
     "destinationPath": "/Example_Archive/PI_Lab2/Project_New/File_New"
   }
 ]
}

In this example, each sourcePath and destinationPath pair in the JSON file meets the above-mentioned criteria, as follows:

  • At command runtime, the Project_New and File_New collection names do not already exist.
  • At command runtime, the PI_Lab1 and PI_Lab2 collection names already exist. After the command executes the first pair, the Project_New collection name exists, just in time for the second pair. 
  • In the first pair, only the Project_New collection name has changed. In the second pair, only the File_New collection name has changed. 
  • No labels