# Loading the configurations at the startup of server with xml backup rather than cdb files

**URL:** <https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271>\
**Category:** CDB and CDB API\
**Created:** [May 29, 2017, 9:01am UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271 "2017-05-29T09:01:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vijaykumar\_A](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@Vijaykumar\_A](https://dmap-community.ductus.global/u/Vijaykumar_A)\
**Post date:** [May 29, 2017, 9:01am UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/1 "2017-05-29T09:01:01Z")

</div>

Hi All,

I removed my .cdb files A.cdb, O.cdb and C.cdb and just placed the xml backup(of current configurations) in the confd directory where aaa\_init.xml is present. When I restarted the server back, I could not get the confd services loaded. Is there any possible way to get the confd loaded at the startup with xml configurations rather than .cdb files?

I mean to say how to make confd services to support xml based configuration instead of .cdb file configuration?

Please help.

Thank you

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [May 29, 2017, 11:51am UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/2 "2017-05-29T11:51:32Z")

</div>

Hi,

There is probably some some issue with your XML file. What does your confd.log / devel.log say?

From the ConfD UG:

> /confdConfig/cdb/dbDir (string)  
> dbDir is the directory on disk which CDB use for its storage and any temporary files being used.  
> It is also the directory where CDB searches for initialization files.

> /confdConfig/cdb/initPath  
> The initPath can contain any number of `<dir>` items, which should be directories. When CDB first starts it will first look in these directories for initialization files.  
> The directories will be searched in the order they are listed, lastly the dbDir is searched.

See also this post for other alternatives:

> [@Problem with external data provider in initial configuration](http://discuss.tail-f.com/t/problem-with-external-data-provider-in-initial-configuration/1223/4):
>
> When loading the initial configuration from an initialization file where you have an external DB connected to ConfD, you can’t put the XML file in the CDB dbDir or CDB initPath, since you are not utilizing CDB to store that data. Rather you want to do something like this: $ confd --start-phase0 -c confd.conf --addloadpath /Users/tailf/confd-6.4.1/etc/confd $ confd --wait-phase0 $ ./my\_extdb\_app & $ confd\_load -d -d -m -i -l init.xml TRACE Connected (maapi) to ConfD TRACE MAAPI\_LOAD\_AL…

---

<div class="post-metadata">

**Author:** ![Vijaykumar\_A](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@Vijaykumar\_A](https://dmap-community.ductus.global/u/Vijaykumar_A)\
**Post date:** [May 29, 2017, 1:19pm UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/3 "2017-05-29T13:19:06Z")

</div>

My logs indicate that I can’t put the XML in to CDB dbDir. Is there any procedure that makes the confd to support the XML configurations rather than CDB? confd\_load is just one case of loading it explicitly.

Is there any configuration that can make it implicitly load the initial configuration of xml at the startup?

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [May 29, 2017, 1:57pm UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/4 "2017-05-29T13:57:30Z")

</div>

> [@Vijaykumar\_A](#):
>
> My logs indicate that I can’t put the XML in to CDB dbDir.

You can initialize CDB from an XML document that is read from the dBDir / initPath at startup. See ConfD 6.4 UG Chapter 5.8. “Loading initial data into CDB”.

---

<div class="post-metadata">

**Author:** ![Vijaykumar\_A](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@Vijaykumar\_A](https://dmap-community.ductus.global/u/Vijaykumar_A)\
**Post date:** [May 30, 2017, 10:01am UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/5 "2017-05-30T10:01:48Z")

</div>

```
<cdb>
    <enabled>true</enabled>
    <initPath>
        <dir>/etc/opt/confd</dir>
    </initPath>
    <dbDir>/var/opt/moc/confd</dbDir>
    <operational>
        <enabled>true</enabled>
    </operational>
</cdb>

```

I placed the xml backup in the initPath. The services are not starting up. confd logs say that daemon thread is dead.

30-May-2017::04:13:55.395 - Daemon nbase-confd-thread died  
 30-May-2017::04:13:55.582 - Daemon router-dcl died

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [May 30, 2017, 10:55am UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/6 "2017-05-30T10:55:33Z")

</div>

> [@Vijaykumar\_A](#):
>
> 30-May-2017::04:13:55.395 - Daemon nbase-confd-thread died 30-May-2017::04:13:55.582 - Daemon router-dcl died

Well, not much for you to do then but to debug why your applications (probably validation applications?) die when you load data into CDB at startup…

To find out which applications (application daemons) you have connected to ConfD you can run `confd --status`

Example:

```
$ pwd
/home/tailf/confd-6.4/examples.confd/validate/c
$ make all start
...
$ confd --status | grep -B 1 daemon
validation points:
  id=vp1 daemonId=0 daemonName=mydaemon

```

---

<div class="post-metadata">

**Author:** ![Vijaykumar\_A](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@Vijaykumar\_A](https://dmap-community.ductus.global/u/Vijaykumar_A)\
**Post date:** [May 31, 2017, 7:24am UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/7 "2017-05-31T07:24:43Z")

</div>

Hi,

I need a small clarification.

Steps followed now:

1. I didn’t delete A.cdb, O.cdb and C.cdb files.
2. I copied the xml backup in directory specified by initPath.
3. I restarted the server.  
I got the database initialized with the backup.  
It will work if I remove all the data or configurations i saved in database and then reboot.  
During start up I am using confd\_load:

ExecStartPost=/bin/sh -c “/opt/libexec/confd\_load -d -l -r /etc/opt/confd/mvcon.xml”

where mvcon.xml is my backup.

This didn’t work when I followed steps 2 and 3 after removing A.cdb, O.cdb and C.cdb files.

So, is it necessary to keep these cdb files during startup initialization of backup?

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [May 31, 2017, 8:43am UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/8 "2017-05-31T08:43:01Z")

</div>

> [@Vijaykumar\_A](#):
>
> 1. I didn’t delete A.cdb, O.cdb and C.cdb files.

Your XML backup was then not read by ConfD at startup.

As I pointed out to you in my reply above 2 days ago, you need to read ConfD 6.4 UG Chapter 5.8. “Loading initial data into CDB”.

---

<div class="post-metadata">

**Author:** ![Vijaykumar\_A](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@Vijaykumar\_A](https://dmap-community.ductus.global/u/Vijaykumar_A)\
**Post date:** [June 1, 2017, 7:14am UTC](https://dmap-community.ductus.global/t/loading-the-configurations-at-the-startup-of-server-with-xml-backup-rather-than-cdb-files/1271/9 "2017-06-01T07:14:35Z")

</div>

I got it. I need to place my xml backup in some other directories rather than CDB dbDir and CDB initPath.

Thank you
