.TH "doc_tutorials_export_md" 3elektra "Sun May 29 2016" "Version 0.8.14" "Elektra" \" -*- nroff -*- .ad l .nh .SH NAME doc_tutorials_export_md \- How-To: kdb export .SS "Introduction" .PP The kdb tool allows users to interact with Elektra's Key Database via the command line\&. This tutorial explains the export function of kdb\&. This command lets you export Keys from the Elektra Key Database\&. .PP The command to use kdb export is: .PP .nf kdb export [options] source [format] .fi .PP .PP In this command, source is the root key of which Keys should be exported\&. For instance, \fCkdb export system/export\fP would export all the keys below system/export\&. Additionally, this command exports keys under the system/elektra directory by default\&. It does this so that information about the keys stored under this directory will be included if the Keys are later imported into an Elektra Key Database\&. This command export Keys to stdout to store them into the Elektra Key Database\&. Typically, the export command is used with redirection to write the Keys to a file\&. .PP .SS "Format" .PP The format argument can be a very powerful option to use with kdb export\&. The format argument allows a user to specify which plug-in is used to export the Keys from the Key Database\&. The user can specify any storage plug-in to serve as the format for the exported Keys\&. For instance, if a user mounted their hosts file to system/hosts using \fCkdb mount /etc/hosts system/hosts hosts\fP, they would be able to export these Keys using the hosts format by using the command \fCkdb export system/hosts hosts > hosts\&.ecf\fP\&. This command would essentially create a backup of their current /etc/hosts file in a valid format for /etc/hosts\&. .PP If no format is specified, the format \fCdump\fP will be used instead\&. The dump format is the standard way of expressing Keys and all their relevant information\&. This format is intended to be used only within Elektra\&. The dump format is a good means of backing up Keys from the Key Database for use with Elektra later such as reimporting them later\&. As of this writing, dump is the only way to fully preserve all parts of the KeySet\&. .PP .SS "Options" .PP The kdb export command takes one special option: .PP .nf -E --without-elektra which omits the system/elektra directory of keys .fi .PP .PP .SS "Example" .PP .PP .nf kdb export system/backup > backup.ecf .fi .PP .PP This command would export all keys stored under system/backup, along with relevant Keys in system/elektra, into a file called backup\&.ecf\&. \fBOther example\fP