\label{doc_help_kdb-import_md_md_doc_help_kdb_import}%
\Hypertarget{doc_help_kdb-import_md_md_doc_help_kdb_import}%
 \hypertarget{doc_help_kdb-import_md_autotoc_md2582}{}\doxysection{SYNOPSIS}\label{doc_help_kdb-import_md_autotoc_md2582}
{\ttfamily kdb import $<$destination$>$ \mbox{[}$<$format$>$\mbox{]}}

Where {\ttfamily destination} is the destination where the user wants the keys to be imported into. {\ttfamily format} is the format of the keys that are imported.\hypertarget{doc_help_kdb-import_md_autotoc_md2583}{}\doxysection{DESCRIPTION}\label{doc_help_kdb-import_md_autotoc_md2583}
If the {\ttfamily format} argument is not passed, then the default format will be used as determined by the value of the {\ttfamily sw/kdb/current/format} key. By default, that key is set to the {\ttfamily storage} format. The {\ttfamily format} attribute relies on Elektra’s plugin system to properly import the configuration. The user can view all plugins available for use by running the kdb-\/plugin-\/list(1) command. To learn about any plugin, the user can simply use the kdb-\/plugin-\/info(1) command.

This command allows a user to import an existing configuration into the key database. The configuration that the user wants to import is read from {\ttfamily stdin}. The user should specify the format that the current configuration or keys are in, otherwise the default format will be used. The default format is {\ttfamily storage} but can be changed by editing the value of the {\ttfamily /sw/elektra/kdb/\#0/current/format} key. The {\ttfamily storage} plugin can be configured at compile-\/time or changed by the link {\ttfamily libelektra-\/storage.\+so}.\hypertarget{doc_help_kdb-import_md_autotoc_md2584}{}\doxysection{CONFLICTS}\label{doc_help_kdb-import_md_autotoc_md2584}
Conflicts can occur when importing a configuration to a part of the database where keys already exist. Conflicts when importing can be resolved using a strategy with the {\ttfamily -\/s} argument.

The strategies implemented by the merge framework are documented in \mbox{\hyperlink{doc_help_elektra-merge-strategy_md}{elektra-\/merge-\/strategy(7)}}.\hypertarget{doc_help_kdb-import_md_autotoc_md2585}{}\doxysection{OPTIONS}\label{doc_help_kdb-import_md_autotoc_md2585}

\begin{DoxyItemize}
\item {\ttfamily -\/H}, {\ttfamily -\/-\/help}\+: Show the man page.
\item {\ttfamily -\/V}, {\ttfamily -\/-\/version}\+: Print version info.
\item {\ttfamily -\/p}, {\ttfamily -\/-\/profile $<$profile$>$}\+: Use a different kdb profile.
\item {\ttfamily -\/C}, {\ttfamily -\/-\/color $<$when$>$}\+: Print never/auto(default)/always colored output.
\item {\ttfamily -\/s}, {\ttfamily -\/-\/strategy $<$name$>$}\+: Specify which strategy should be used to resolve conflicts.
\item {\ttfamily -\/v}, {\ttfamily -\/-\/verbose}\+: Explain what is happening. Prints additional information in case of errors/warnings.
\item {\ttfamily -\/d}, {\ttfamily -\/-\/debug}\+: Give debug information. Prints additional debug information in case of errors/warnings.
\item {\ttfamily -\/c}, {\ttfamily -\/-\/plugins-\/config}\+: Add a configuration to the format plugin.
\end{DoxyItemize}\hypertarget{doc_help_kdb-import_md_autotoc_md2586}{}\doxysection{KDB}\label{doc_help_kdb-import_md_autotoc_md2586}

\begin{DoxyItemize}
\item {\ttfamily /sw/elektra/kdb/\#0/current/verbose}\+: Same as {\ttfamily -\/v}\+: Explain what is happening (output merged keys).
\item {\ttfamily /sw/elektra/kdb/\#0/current/format} Change default format (if none is given at commandline) and built-\/in default is not your preferred format.
\end{DoxyItemize}\hypertarget{doc_help_kdb-import_md_autotoc_md2587}{}\doxysection{EXAMPLES}\label{doc_help_kdb-import_md_autotoc_md2587}
To import a configuration stored in the XML format in a file called {\ttfamily example.\+xml} below {\ttfamily user\+:/keyset}\+:~\newline
 {\ttfamily kdb import user\+:/keyset xmltool $<$ example.\+xml}

To import a configuration stored in the {\ttfamily ini} format in a file called {\ttfamily example.\+ini} below {\ttfamily user\+:/keyset} replacing any previous keys stored there\+:~\newline
 {\ttfamily cat example.\+ini $\vert$ kdb import -\/s cut user\+:/keyset ini}

To import a configuration stored in the {\ttfamily ini} format in a file called {\ttfamily example.\+ini} below {\ttfamily user\+:/keyset} keeping any previous keys stored there that aren\textquotesingle{}t present in the newly imported configuration\+:~\newline
 {\ttfamily cat example.\+ini $\vert$ kdb import -\/s import user\+:/keyset ini}

To restore a backup (stored as {\ttfamily sw.\+ecf}) of a user\textquotesingle{}s configuration below {\ttfamily system\+:/sw}\+:~\newline
 {\ttfamily cat sw.\+ecf $\vert$ kdb import system\+:/sw}

To import a sample {\ttfamily xml} content with the {\ttfamily xerces} plugin\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\# import two keys from a xml string}
\DoxyCodeLine{kdb import user:/tests/kdb-\/import/ xerces <<< "{}<?xml version=\(\backslash\)"{}1.0\(\backslash\)"{} encoding=\(\backslash\)"{}UTF-\/8\(\backslash\)"{} standalone=\(\backslash\)"{}no\(\backslash\)"{} ?><kdb-\/import><one>one</one><two>two</two></kdb-\/import>"{}}
\DoxyCodeLine{}
\DoxyCodeLine{\# get the values and verify they got imported correctly}
\DoxyCodeLine{kdb get user:/tests/kdb-\/import/one}
\DoxyCodeLine{\#> one}
\DoxyCodeLine{kdb get user:/tests/kdb-\/import/two}
\DoxyCodeLine{\#> two}
\DoxyCodeLine{kdb rm -\/r user:/tests/kdb-\/import}

\end{DoxyCode}


To import a sample {\ttfamily xml} content via specifying the file format directly\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\# import two keys from a xml string}
\DoxyCodeLine{kdb import user:/tests/kdb-\/import/ xml <<< "{}<?xml version=\(\backslash\)"{}1.0\(\backslash\)"{} encoding=\(\backslash\)"{}UTF-\/8\(\backslash\)"{} standalone=\(\backslash\)"{}no\(\backslash\)"{} ?><kdb-\/import><one>one</one><two>two</two></kdb-\/import>"{}}
\DoxyCodeLine{}
\DoxyCodeLine{\# get the values and verify they got imported correctly}
\DoxyCodeLine{kdb get user:/tests/kdb-\/import/one}
\DoxyCodeLine{\#> one}
\DoxyCodeLine{kdb get user:/tests/kdb-\/import/two}
\DoxyCodeLine{\#> two}
\DoxyCodeLine{}
\DoxyCodeLine{kdb rm -\/r user:/tests/kdb-\/import}

\end{DoxyCode}
\hypertarget{doc_help_kdb-import_md_autotoc_md2588}{}\doxysection{SEE ALSO}\label{doc_help_kdb-import_md_autotoc_md2588}

\begin{DoxyItemize}
\item \mbox{\hyperlink{doc_help_elektra-merge-strategy_md}{elektra-\/merge-\/strategy(7)}} 
\end{DoxyItemize}