# Running the Agent as a Windows Service

Copia Agent Version 1.0 can run as a Windows service. Running as a service improves agent reliability and enables non-interactive backups of some device types. Non-interactive backups do not require a Windows user to be logged into the agent machine.

{% hint style="info" %}
**Although the Agent can back up all device types when running as a service**, only certain device types support non-interactive backups. See [#device-support](#device-support "mention") for more information.
{% endhint %}

### Installing Copia Agent Version 1.0

You must manually upgrade to Copia Agent Version 1.0 in order to run as a service and begin executing non-interactive backups. Older versions, such as Version 0.1.72, do not support running as a service and will not automatically upgrade to Version 1.0. The agent will continue to receive automatic software updates once the upgrade is complete.

To upgrade to Copia Agent Version 1.0:

1. Uninstall the Copia Agent.
2. Log into Copia in a browser and navigate to the Agents tab in one of your DeviceLink Sites.
3. Click “Download **New** Agent Installer.” Do not click "Download **Legacy** Agent Installer."
4. Run the installer. This requires Windows Administrator privileges.
5. The agent should start automatically after installation finishes. If it doesn’t start automatically, search for “Copia Agent” in the Windows search bar and left-click it.
6. Allow the agent several seconds to start up and sign into Copia. If the agent doesn’t automatically sign in and link itself after 30 seconds, manually sign in and link the agent to Copia.

### Enabling the Windows Service

Copia Agent Version 1.0 can run as an interactive application or as a Windows service. For some IT environments, running as a service may provide advantages in terms of reliability and/or security policy compliance, as it enables logging out of the Desktop session while jobs continue to run.&#x20;

However, there are some complexities associated with running as a service:

* IT policies may prohibit the installation of a Windows service on the agent machine, or:
* Some vendor software may work differently when run as a service vs. as an application. If this happens to you, please [contact Copia support](https://www.copia.io/support-requests) as this behavior is unintentional.

The agent runs as an application by default in order to minimize disruptions to existing DeviceLink jobs.

To run the agent as a service, tick the "Run as a service" checkbox:

![](https://3704730939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lSQNVI3DZ15V7kjkMCA%2Fuploads%2FdzVC3Yihko3LLrxX76Wo%2Fimage.png?alt=media\&token=6618b349-1b2d-4155-a442-97a3e1e509e6)

{% hint style="warning" %}
You must have local Administrator privileges to change the "Run as service" setting.
{% endhint %}

### Device Support

**The agent can perform interactive backups of all DeviceLink devices regardless of whether it runs as a service or as an application.** However, the agent must run as a service to execute non-interactive backups. An interactive backup requires a Windows user to be logged into the agent machine; a non-interactive backup does not.

<table><thead><tr><th width="197.97222900390625">"Run as a Service"</th><th width="268.488525390625">Can perform interactive backups?</th><th>Can perform non-interactive  backups?</th></tr></thead><tbody><tr><td>Enabled</td><td><mark style="color:green;"><strong>✓</strong></mark> Yes, for all devices</td><td><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> Yes, for some devices (see below)</td></tr><tr><td>Disabled</td><td><mark style="color:green;"><strong>✓</strong></mark> Yes, for all devices</td><td><mark style="color:red;"><strong>✕</strong></mark> No, for all devices</td></tr></tbody></table>

Only some devices support non-interactive backups:

<table><thead><tr><th width="278">Device</th><th>Non-Interactive Backups</th></tr></thead><tbody><tr><td>Rockwell Studio/RSLogix 5000</td><td><mark style="color:green;"><strong>✓</strong></mark> Supported</td></tr><tr><td>Siemens Step7 5.x</td><td><mark style="color:green;"><strong>✓</strong></mark> Supported</td></tr><tr><td>Beckhoff TwinCAT 3</td><td>🏗️ Unsupported &#x26; Planned</td></tr><tr><td>CODESYS v3</td><td>🏗️ Unsupported &#x26; Planned</td></tr><tr><td>Copia FTP/sFTP/SCP</td><td>🏗️ Unsupported &#x26; Planned</td></tr><tr><td>Copia Script</td><td>🏗️ Unsupported &#x26; Planned</td></tr><tr><td>FANUC Robot</td><td>🏗️ Unsupported &#x26; Planned</td></tr><tr><td>Schneider Control Expert</td><td>🏗️ Unsupported &#x26; Planned</td></tr><tr><td>Rockwell PanelView ME HMI</td><td><mark style="color:red;"><strong>✕</strong></mark> Unsupported &#x26; Not Planned</td></tr><tr><td>Rockwell RSLogix 500</td><td><mark style="color:red;"><strong>✕</strong></mark> Unsupported &#x26; Not Planned</td></tr><tr><td>Siemens Step7 TIA Portal</td><td><mark style="color:red;"><strong>✕</strong></mark> Unsupported &#x26; Not Planned</td></tr></tbody></table>

Unsupported devices still must be backed up interactively, even if the agent is running as a service. That means the Agent tray application must be running on an unlocked screen in an active Windows logon session. If these conditions are not met and the Agent starts backing up a device that requires an interactive session, the backup will time out unless you log in and launch the tray application.

{% hint style="danger" %}
If any of the Agent's devices require an interactive session, you must still keep the Agent tray application running and the screen unlocked, even when running as a service. Failure to do so will result in the backup of only those devices that support non-interactive backups.
{% endhint %}

### Changing the Service Logon Account

The Copia Agent executes non-interactive backups in a Windows service. The service logs onto the host as the Local System account. Local System provides the service with the extensive local privileges necessary to execute device backups.

You may change the service logon account but Copia cannot guarantee that backups will succeed. To change the logon account:

1. Determine the new account. The account <mark style="background-color:$danger;">**must**</mark> belong to the local Administrators group and **possess the "Log on as a service" permission** within the local security policies.
   1. You can validate the "Local Administrators" by looking at "Local Users And Groups" (accessible via `Win+R` > `lusrmgr.msc` ) and navigating to "Groups".
   2. You can validate the "Log on as a service" permission in "Local Security Policy" (accessible via `Win+R` > `secpol.msc`), navigating to "Local Policies" > "User Rights Assignment", and seeing who has access to "Log on as a service".
2. Open the Service Control Manager (`Win+R` > `services.msc`).
3. Right-click "Copia Agent Service."
4. Click "Properties."
5. Click the "Log On" tab.
6. Click the "This account:" radio button.
7. Enter the account name and password if applicable.
8. Click "OK."
9. If the service is running, it must be restarted for the new account to take effect. **Warning: restarting the service will fail an in-progress backup**. Right-click "Copia Agent Service" and click "Restart."
