---json { "aliases": [ { "path": ":docs:tabli:data:move" } ], "page_id": "hkg7zrumd54mfs5x3yeoh" } --- ====== Tabul - Data Move Command ====== ===== About ===== ''data move'' is a [[docs:tabul:tabul|tabul]] [[docs:tabul:command|command]] that supports the [[docs:op:move|move data operation]]. This is an alias command of the [[transfer|data transfer command]] where the ''transfer-operation'' [[docs:tabul:option|option]] has been set to ''move''. ===== Example ===== ==== Change the file extension ==== The below command will: * select all [[:docs:resource:text|text file]] * from the [[:docs:connection:cd|current directory]] * and change the extension to `md` in the [[docs:flow:template_data_uri|target uri]] thanks to the [[:docs:common:globbing|back reference $1]] ```ps tabul data move *.txt@cd '$1.md@cd' ``` ===== Syntax ===== tabul data move -h Tabul data move =============== Move one or more data resources. A `move` operation will perform: * a `rename` if the target connection and the source connection are the same * a `copy` and `drop` of the source if the target connection and the source connection are not the same Note: This is just a alias command to the `transfer` command with the transfer operation option set to `copy` with a drop of the source. Examples -------- 1 - To move the table `time` from the data store `sqlite` into the file `time.csv`, you would execute tabul data move time@sqlite time.csv 2 - To move the file `foo.txt` to the `dir` directory `dir/foo.txt`, you would execute tabul data move foo.txt dir/foo.txt Syntax ------ tabul data move [options|flags] where: Arguments: A data selector that select the data resources to transfer A target data uri (Example: table@connection or foo.csv@cd) Cross Data Transfer Options: -bs,--buffer-size defines the size of the memory buffer between the source and target threads -mdu,--metrics-data-uri defines a target data uri where the data metrics should be exported -out,--output-type The resource that is passed as output -pt,--processing-type how to process the inputs (one by one or in batch) -sfs,--source-fetch-size defines the size of the network message from the source to fetch the data -so,--source-operation defines the data operation (drop or truncate) on the source after transfer. Note: A `move` operation will drop the source. -tbs,--target-batch-size defines the batch size against the target data resource -tcf,--target-commit-frequency defines the commit frequency in number of batches against the target data resource -to,--target-operation defines the data operations (drop or truncate) on the existing target before transfer. A `replace` operation will drop the target. -twc,--target-worker-count defines the target number of thread against the target connection -tmc,--transfer-mapping-columns defines the columns mapping between the source and the target -tmm,--transfer-mapping-method defines the method used to map the source columns to the target columns -tms,--transfer-mapping-strict defines if a map by name or position is strict -op,--transfer-operation defines the transfer operation (insert, update, delete, upsert, merge, copy). -tut,--transfer-upsert-type defines the type of upsert operation (merge, insert, insert-update, update-insert). -wp,--with-parameters defines if parameters are used in the SQL statement Data Definition Options: -sa,--source-attribute Set a source attribute -ta,--target-attribute Set a target attribute Selection Options: --strict-selection If set the selection will return an error if no data resources have been selected -wd,--with-dependencies If set, the dependencies will be also selected Options: -t,--type The type of the resource -vc,--virtual-column Add a virtual column with the value of a data resource attribute Global Options: -ah,--app-home The app home directory (default to the .tabul.yml file directory) -vf,--conf The path to a configuration file -ee,--exec-env The execution environment (prod or dev) -h,--help Print this help -l,--log-level Set the log level -ns,--not-strict A minor error will not stop the process. -odu,--output-data-uri defines the output data uri for the feedback data (default: console) -oo,--output-operation defines the data operations (replace, truncate) on an existing output resource before transfer. -oop,--output-transfer-operation defines the output transfer operation (insert, update, merge, copy). Default to `copy` for a file system and `insert` for a database. -pp,--passphrase A passphrase (master password) to decrypt the encrypted vault values (Env: TABUL_PASSPHRASE) --pipe-mode Use pipe mode if you want to pipe the output in a shell. Pipe mode will not print the headers (ie column name) and will not make the control character visible -v,--version Print version information