# Backing up a controller via an Addin

**URL:** <https://tech-community.robotics.abb.com/t/backing-up-a-controller-via-an-addin/8393>\
**Category:** Developer Tools\
**Created:** [August 2, 2018, 5:33am UTC](https://tech-community.robotics.abb.com/t/backing-up-a-controller-via-an-addin/8393 "2018-08-02T05:33:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottMHA](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@scottMHA](https://tech-community.robotics.abb.com/u/scottMHA)\
**Post date:** [August 2, 2018, 5:33am UTC](https://tech-community.robotics.abb.com/t/backing-up-a-controller-via-an-addin/8393/1 "2018-08-02T05:33:18Z")

</div>

I have an addin with a button to be able to backup all controller found on a network scan.

This works perfectly for virtual controllers but i get a generic error when attempting to backup online (real world) controllers. See below for how i currently do it. Any suggestions on another approach?

```auto
            NetworkScanner runningcontrollers = new NetworkScanner();
            runningcontrollers.Scan();
            ControllerInfo[] aCollection = runningcontrollers.GetControllers();
            int NumOfActiveControllers = aCollection.Count();

            if (NumOfActiveControllers != 0)
            {
                for (int i = 0; i < aCollection.Count(); i++)
                {
                    systemId = aCollection[i].SystemId;
                    Controller con = new Controller(systemId);
                    con.BackupCompleted += Con_BackupCompleted;

                    con.Logon(UserInfo.DefaultUser);

                    con.Backup("C:\temp\backups");

```

---

<div class="post-metadata">

**Author:** ![AdamSG](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AdamSG](https://tech-community.robotics.abb.com/u/AdamSG)\
**Post date:** [August 7, 2018, 10:23am UTC](https://tech-community.robotics.abb.com/t/backing-up-a-controller-via-an-addin/8393/2 "2018-08-07T10:23:03Z")

</div>

Hello!

When you backup using **con.Backup** the path you specify as an argument is the path on the remote controller and not the path on your local machine. It could for example be  
**/hd0a/XXX-XXXXX/HOME/MyBackup**.

If you want to save the backup to your local machine you could first copy it over from the remote controller to your local machine and then remove the backup from the controller.

---

<div class="post-metadata">

**Author:** ![scottMHA](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@scottMHA](https://tech-community.robotics.abb.com/u/scottMHA)\
**Post date:** [October 3, 2018, 9:14am UTC](https://tech-community.robotics.abb.com/t/backing-up-a-controller-via-an-addin/8393/3 "2018-10-03T09:14:24Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![scottMHA](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@scottMHA](https://tech-community.robotics.abb.com/u/scottMHA)\
**Post date:** [October 12, 2018, 9:10am UTC](https://tech-community.robotics.abb.com/t/backing-up-a-controller-via-an-addin/8393/4 "2018-10-12T09:10:52Z")

</div>

> [@AdamSG](#):
>
> Hello!
> 
> When you backup using **con.Backup** the path you specify as an argument is the path on the remote controller and not the path on your local machine. It could for example be  
> **/hd0a/XXX-XXXXX/HOME/MyBackup**.
> 
> If you want to save the backup to your local machine you could first copy it over from the remote controller to your local machine and then remove the backup from the controller.

Hi Adam,

You mention above that i need to copy the backup from the remote controller but when attempting to do so using both the FileSystem.GetDirectory and FileSystem.CopyDirectory i get the exception “Object reference not set to an instance of an object”.

Both the remote file and destination exists, any ideas on this?

---

<div class="post-metadata">

**Author:** ![Johannes\_Weiman](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@Johannes\_Weiman](https://tech-community.robotics.abb.com/u/Johannes_Weiman)\
**Post date:** [October 12, 2018, 2:14pm UTC](https://tech-community.robotics.abb.com/t/backing-up-a-controller-via-an-addin/8393/5 "2018-10-12T14:14:09Z")

</div>

What version of PCSDK are you using?

---

<div class="post-metadata">

**Author:** ![scottMHA](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@scottMHA](https://tech-community.robotics.abb.com/u/scottMHA)\
**Post date:** [October 12, 2018, 2:40pm UTC](https://tech-community.robotics.abb.com/t/backing-up-a-controller-via-an-addin/8393/6 "2018-10-12T14:40:59Z")

</div>

> [@Johannes Weiman](#):
>
> What version of PCSDK are you using?

6.07
