How can I scan all config infos and save to external relational database?

I must scan entire data in cdb and copy them all to external relational database,
but the external relational database doesn’t support hierarchical data model like YANG or XML.

Do you have any solution for this kind of case?
This is an big issue at my office currently and I’m in a big trouble because of this.

Do you have any sample codes or use cases for that?

Help me~~

The major relational DBs like mySQL and Postgres support loading XML. If your DB does not support loading XML, I suggest you write one. There are likely examples available if you search (e.g. google) for them.

Thanks, cohult.

Do you have any example codes for loading entire data from cdb to Postgres ?
Fully scan all data in cdb --> convert it to xml file --> loading to postgresql ?

  1. How to fully scan all data in cdb ?
  2. How to covert the data to xml data in order to load it to postgresql?

You can use for example the confd_load tool that ships with ConfD.

$ confd_load -dd -o -F p -p / > mycdbcontent.xml

Run confd_load -h or see man page for details.