Moving the lists from one namespace to another

Hi,
We have a requirement for moving the whole list from one namespace to another. Does confd has any api to support this during the upgrade process.

Thanks
Phani

Hi Phani,

This is described in the ConfD UG:

5.11. Using MAAPI to modify CDB during upgrade

5.12. More complex schema upgrades

There is also examples in the example collection illustrating how this
can be done. See $CONFD_DIR/examples.confd/cdb_upgrade/moved_servers

Hi Cohult,
Thanks for the response. Instead of traversing each list entry, is there any alternate api available ?

can i use maapi_copy_tree api, to move /a/servers to /b/servers, giving maapi_copy_tree(ms, th, “/a/servers”, “/b/servers”); Here servers is a list.

Thanks
Phani

Hi Phani,

During upgrade you need to first read the list from the old database using the CDB API and then write the list to the new database using MAAPI.

If it an entire list that you are moving I suggest you use cdb_get_objects() or cdb_get_values() to read from the old database and use maapi_set_object() or maapi_set_values() to write to the new database.

See confd_lib_cdb and confd_lib_maapi man pages for examples.

Best regards,
Conny