# Copy-config from candidate to running

**URL:** <https://dmap-community.ductus.global/t/copy-config-from-candidate-to-running/784>\
**Category:** NETCONF\
**Created:** [October 20, 2016, 10:47am UTC](https://dmap-community.ductus.global/t/copy-config-from-candidate-to-running/784 "2016-10-20T10:47:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yi\_z\_zhao](https://avatars.discourse-cdn.com/v4/letter/y/45deac/32.png) [@yi\_z\_zhao](https://dmap-community.ductus.global/u/yi_z_zhao)\
**Post date:** [October 20, 2016, 10:47am UTC](https://dmap-community.ductus.global/t/copy-config-from-candidate-to-running/784/1 "2016-10-20T10:47:10Z")

</div>

Netconf copy-config from candidate to running return error with “access denied”. I have enabled candidate datastore and netconf/capabilities/candidate. While the copy-config from running to candidate, edit-config on candidate, and commit to running datastore success.

Please help to confirm how to perform copy-config from candidate to running.

My netconf operation is as below.

```
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
        <copy-config>
                <target>
                        <running/>
                </target>
                <source>
                        <candidate/>
                </source>
        </copy-config>
</rpc>

```

]]\>]]\>\<?xml version="1.0" encoding="UTF-8"?\>  
  
application  
access-denied  
error  
  
]]\>]]\>

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [October 20, 2016, 12:37pm UTC](https://dmap-community.ductus.global/t/copy-config-from-candidate-to-running/784/2 "2016-10-20T12:37:07Z")

</div>

If you want to copy from candidate to running the `:writable-running` capability must be set and `/confdConfig/running/access` must be `read-write`

---

<div class="post-metadata">

**Author:** ![nabil](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@nabil](https://dmap-community.ductus.global/u/nabil)\
**Post date:** [October 20, 2016, 5:45pm UTC](https://dmap-community.ductus.global/t/copy-config-from-candidate-to-running/784/3 "2016-10-20T17:45:27Z")

</div>

Why not just commit the candidate?

---

<div class="post-metadata">

**Author:** ![yi\_z\_zhao](https://avatars.discourse-cdn.com/v4/letter/y/45deac/32.png) [@yi\_z\_zhao](https://dmap-community.ductus.global/u/yi_z_zhao)\
**Post date:** [October 21, 2016, 5:27am UTC](https://dmap-community.ductus.global/t/copy-config-from-candidate-to-running/784/4 "2016-10-21T05:27:31Z")

</div>

I have already set running datastore as read-write as below. But still cannot copy-config from candidate to running.

 read-write

---

<div class="post-metadata">

**Author:** ![yi\_z\_zhao](https://avatars.discourse-cdn.com/v4/letter/y/45deac/32.png) [@yi\_z\_zhao](https://dmap-community.ductus.global/u/yi_z_zhao)\
**Post date:** [October 21, 2016, 5:33am UTC](https://dmap-community.ductus.global/t/copy-config-from-candidate-to-running/784/5 "2016-10-21T05:33:50Z")

</div>

commit success. Want to confirm if it’s restricted that only commit can be used to write candidate configuration to running, the copy-config from candidate to running is not supported?

RFC 6241 does not restrict copy-config target/source.  
Quoting from RFC 6241:  
"  
7.3.   
Description: Create or replace an entire configuration datastore  
with the contents of another complete configuration datastore. If  
the target datastore exists, it is overwritten. Otherwise, a new  
one is created, if allowed."

---

<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:** [October 21, 2016, 5:53am UTC](https://dmap-community.ductus.global/t/copy-config-from-candidate-to-running/784/6 "2016-10-21T05:53:33Z")

</div>

You can copy the candidate to running using with confd.conf set as @jjohansson describes. But as @nabil writes, the standard way is to commit the candidate to running.

```
    <rpc message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <copy-config>
         <target>
           <running/>
         </target>
         <source>
           <candidate/>
         </source>
       </copy-config>
     </rpc>
```
