# Copy-config vs discard-changes

**URL:** <https://dmap-community.ductus.global/t/copy-config-vs-discard-changes/2207>\
**Category:** NETCONF\
**Created:** [January 2, 2019, 6:38pm UTC](https://dmap-community.ductus.global/t/copy-config-vs-discard-changes/2207 "2019-01-02T18:38:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aruna](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@Aruna](https://dmap-community.ductus.global/u/Aruna)\
**Post date:** [January 2, 2019, 6:38pm UTC](https://dmap-community.ductus.global/t/copy-config-vs-discard-changes/2207/1 "2019-01-02T18:38:32Z")

</div>

Hi,

How safe it is not to use copy-config for candidate data supported devices with direct running writable disabled. I would like to know the behavior from standard perspective, and also if there is any Confd specific behavior, please highlight behavior for my understanding in your response.

I have been using copy-config for all my edit-config operations on the candidate data store supported devices, but now I am thinking to avoid this(for performance reasons) if running data store writable only through candidate data store.

Here the steps we perform involved for an edit-config operation on CANDIDATE data store enabled devices,  
• Lock CANDIDATE data store  
• copy-config from RUNNING to CANDIDATE  
• Perform edit-config on CANDIDATE data store  
• Perform commit  
• Unlock CANDIDATE data store

Now my questions are,

1. If there are any uncommitted changes from a session with lock acquired, does unlock would discard changes automatically similar to using discard-changes explicitly or another client need to use discard-changes explicitly?
2. if there are any uncommitted changes from “config shared” mode, I assume lock will fail for any other client?

Thanks,

---

<div class="post-metadata">

**Author:** ![waitai](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/waitai/32/436_2.png) [@waitai](https://dmap-community.ductus.global/u/waitai)\
**Post date:** [January 4, 2019, 9:26pm UTC](https://dmap-community.ductus.global/t/copy-config-vs-discard-changes/2207/2 "2019-01-04T21:26:19Z")

</div>

> [@Aruna](#):
>
> If there are any uncommitted changes from a session with lock acquired, does unlock would discard changes automatically similar to using discard-changes explicitly or another client need to use discard-changes explicitly?

The `<unlock>` operation will automatically discard any uncommitted changes.

> [@Aruna](#):
>
> if there are any uncommitted changes from “config shared” mode, I assume lock will fail for any other client?

Yes, the `<lock>` operation will fail if there are any outstanding changes.
