---
title: "Server-wide backup"
description: "Create and manage a server-wide backup task that automatically applies a backup configuration to all databases as per-database backup tasks."
url: "https://docs.ravendb.net/7.2/backup/create/periodic-tasks/server-wide-backup"
version: "7.2"
---

# Server-wide backup

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Periodic server-wide backup tasks

> **Note**
>
> - Use a [server-wide backup task](https://docs.ravendb.net/7.2/backup/overview.md#server-wide-backup) to define a **backup configuration** once and have RavenDB automatically apply it to **all your databases** as per-database backup tasks.
>
> - This article explains how to create and manage the parent server-wide backup configuration and its derived database tasks.  
>   For detailed guidance on backup configuration options (such as backup types, scope, scheduling, storage, retention policy, and encryption), see the [periodic database-backup task](https://docs.ravendb.net/7.2/backup/create/periodic-tasks/database-backup.md) article.
>
> - In this article:
>   - [Overview](#overview)
>
>   - [Creating and managing server-wide backup tasks using the client API](#creating-and-managing-server-wide-backup-tasks-using-the-client-api)
>     - [Creating a server-wide backup task](#creating-a-server-wide-backup-task)
>     - [Getting a derived backup task status](#getting-a-derived-backup-task-status)
>     - [Updating a server-wide backup task](#updating-a-server-wide-backup-task)
>     - [Deleting a server-wide backup task](#deleting-a-server-wide-backup-task)
>     - [Managing backup operations](#managing-backup-operations)
>       - [Triggering an immediate backup operation](#triggering-an-immediate-backup-operation)
>       - [Delaying a running backup operation](#delaying-a-running-backup-operation)
>       - [Aborting a running backup operation](#aborting-a-running-backup-operation)
>     - [Syntax](#syntax)
>       - [Methods](#methods)
>       - [Classes](#classes)
>
>   - [Creating and managing server-wide backup tasks via Studio](#creating-and-managing-server-wide-backup-tasks-via-studio)
>     - [Creating a server-wide backup task](#creating-a-server-wide-backup-task)
>     - [Managing server-wide tasks](#managing-server-wide-tasks)
>       - [Managing the parent server-wide task](#managing-the-parent-server-wide-task)
>       - [Managing derived database tasks](#managing-derived-database-tasks)
>         - [Running a backup operation immediately](#running-a-backup-operation-immediately)
>     * [Delaying or aborting a running backup operation](#delaying-or-aborting-a-running-backup-operation)

## Overview {#overview}

A server-wide backup task is a **backup configuration template** that is automatically applied to all your databases as **per-database backup tasks**.

- An individual database backup task will also be automatically added to any database created **after** defining a server-wide backup task.
- When creating the task, you can exclude specific databases from the backup, so that the configuration will only be applied to the databases you want to back up.

Each derived **database task** is a persistent scheduled entity that runs **backup operations** on the schedule defined by the parent server-wide task.

- You can access each derived task to check its latest and next scheduled backups, or to trigger an immediate database backup.
- The derived tasks continue to share the configuration defined by the server-wide template.
  - Modifying the configuration or excluding databases from the backup can only be done through the parent server-wide task.
  - Deleting the server-wide task will remove all derived tasks.

A **backup operation** is the actual execution of a backup.  
It starts, runs, and completes (or fails).  
Once a backup operation is running, you can delay or abort it, e.g., to free up system resources.

For example:

- You create a **server-wide backup task** named `NightlyBackup` that defines a full backup each night at midnight.
- The server automatically applies your configuration as **per-database backup tasks**, naming each derived task `Server Wide Backup, NightlyBackup`.
- Each derived database task executes a **backup operation** every midnight.

## Creating and managing server-wide backup tasks using the client API {#creating-and-managing-server-wide-backup-tasks-using-the-client-api}

### Creating a server-wide backup task

To create a server-wide backup task:

- Define a **backup configuration** using a `ServerWideBackupConfiguration` instance.
  - `ServerWideBackupConfiguration` inherits from [PeriodicBackupConfiguration](#backup-configuration-classes), which defines all configuration options used by both server-wide and regular database backup tasks.  
    See the [periodic database backup task](https://docs.ravendb.net/7.2/backup/create/periodic-tasks/database-backup.md) article for guidance about these options.
  - `ServerWideBackupConfiguration` adds the following server-wide-specific property:
    - `ExcludedDatabases` - A list of databases to [exclude](https://docs.ravendb.net/7.2/backup/overview.md#excluding-databases-from-the-backup) from the server-wide backup.

- Pass your populated instance to `PutServerWideBackupConfigurationOperation` to register the server-wide task, create the derived database tasks, and schedule the backup routine for each database.

- **Example**:
  ```csharp
  var serverWideBackupConfiguration = new ServerWideBackupConfiguration
  {
      // Task is enabled
      Disabled = false,

      // Task name 
      Name = "FullAndIncrementalBackup",

      // Create a logical backup
      BackupType = BackupType.Backup,

      // Run a full backup every 6 hours
      FullBackupFrequency = "0 */6 * * *",

      // Run an incremental backup every 20 minutes
      IncrementalBackupFrequency = "*/20 * * * *",

      // Keep backups locally
      LocalSettings = new LocalSettings
      {
          FolderPath = backupPath
      },

      // Also upload backups to Azure
      AzureSettings = new AzureSettings
      {
          // Use your Azure credentials here
      },

      // Keep backups for 7 days
      RetentionPolicy = new RetentionPolicy
      {
          Disabled = false,
          MinimumBackupAgeToKeep = TimeSpan.FromDays(7)
      },

      // Encrypt backups using a user-provided Base64 key
      BackupEncryptionSettings = new BackupEncryptionSettings
      {
          EncryptionMode = EncryptionMode.UseProvidedKey,
          Key = "OI7Vll7DroXdUORtc6Uo64wdAk1W0Db9ExXXgcg5IUs="
      },

      // Exclude the Customers database from the server-wide backup
      ExcludedDatabases = new[] 
      { 
          "Customers"
      }
  };

  // Create the server-wide task
  var result = await store.Maintenance.Server.SendAsync(
      new PutServerWideBackupConfigurationOperation(
          serverWideBackupConfiguration));
  ```

### Getting a derived backup task status

To retrieve the status of a derived database task after its last run, use `GetPeriodicBackupStatusOperation` with the task ID.

- If you do not have the task ID, you can get it using `GetOngoingTaskInfoOperation` with the names of the task and its database.
- The retrieved status reflects the **most recent completed backup run**, whether it was scheduled or [triggered manually](https://docs.ravendb.net/7.2/backup/create/periodic-tasks/database-backup.md#triggering-an-immediate-backup-operation).
- The status includes the number of backups performed by the task, and details about the last backup such as the backup timestamp, duration, destination path, and error information (if any).

[See GetPeriodicBackupStatusOperation syntax](https://docs.ravendb.net/7.2/backup/create/periodic-tasks/database-backup.md#task-management)

##### Example:

```csharp
// Database name 
var databaseName = "Products";

// Server-wide task name 
var serverWideTaskName = "FullAndIncrementalBackup";

// Pass the server-wide task name to get the derived task name 
var derivedTaskName = 
    PutServerWideBackupConfigurationCommand.GetTaskName(serverWideTaskName);

// Pass the derived task name to get the derived task info 
var derivedTask = await store.Maintenance.ForDatabase(databaseName).SendAsync( 
    new GetOngoingTaskInfoOperation(derivedTaskName, OngoingTaskType.Backup)) 
    as OngoingTaskBackup;

// Ensure the derived task exists for the chosen database 
if (derivedTask == null) 
{ 
    throw new InvalidOperationException(
        $"The server-wide periodic backup task '{derivedTaskName}' " + 
        $"is not found in database '{databaseName}'."); 
}

// Get the backup status for this database's derived task 
var statusResult = await store.Maintenance.ForDatabase(databaseName).SendAsync( 
    new GetPeriodicBackupStatusOperation(derivedTask.TaskId));

var status = statusResult.Status;

// Status is null if no backup has run yet 
if (status == null) 
{ 
    // No backup has been executed yet for this task 
    return; 
}

// Check for errors in the last backup run 
if (status.Error != null) 
{ 
    string errorMessage = status.Error.Exception; 
    DateTime errorTime = status.Error.At; 
}

// Access last backup details 
bool wasFull = status.IsFull; 
long? lastEtag = status.LastEtag; 
long? durationMs = status.DurationInMs; 
DateTime? lastFullBackup = status.LastFullBackup; 
DateTime? lastIncrementalBackup = status.LastIncrementalBackup;

// Access backup destination details
 string? localBackupDir = status.LocalBackup?.BackupDirectory;
```

### Updating a server-wide backup task

To update an existing backup task:

- Retrieve the server-wide task configuration that you want to update.
  - Use `GetServerWideBackupConfigurationOperation` to retrieve a **single** configuration by name,
  - Or use `GetServerWideBackupConfigurationsOperation` to retrieve **all** existing configurations and select the one you want by a property of your choice.
- Modify the configuration without changing the existing `TaskId`.
- Use `PutServerWideBackupConfigurationOperation` to apply the modified configuration.

##### Example:

###### Retrieve a single configuration

```csharp
// Retrieve existing configuration by name
var existing = await store.Maintenance.Server.SendAsync(
    new GetServerWideBackupConfigurationOperation("FullAndIncrementalBackup"));

// Ensure the task exists
Assert.NotNull(existing);

// Update by modifying the retrieved instance
existing.FullBackupFrequency = "0 */7 * * *";
existing.IncrementalBackupFrequency = "*/20 * * * *";

// Send update
await store.Maintenance.Server.SendAsync(
    new PutServerWideBackupConfigurationOperation(existing));
```

###### Retrieve all configurations and select one

```csharp
// Retrieve all server-wide backup configurations
var serverWideBackups = await store.Maintenance.Server.SendAsync(
new GetServerWideBackupConfigurationsOperation());

// Select a configuration by a property (FullBackupFrequency in this example)
var existing = serverWideBackups.FirstOrDefault(x => x.FullBackupFrequency == "0 */7 * * *");

Assert.NotNull(existing);

// Update by modifying the retrieved instance (keeping the TaskId unchanged)
existing.FullBackupFrequency = "0 */8 * * *";
existing.IncrementalBackupFrequency = "*/30 * * * *";

// Send update
await store.Maintenance.Server.SendAsync(
    new PutServerWideBackupConfigurationOperation(existing));
```

### Deleting a server-wide backup task

To delete a server-wide backup task and remove all its derived database tasks:

- Use `DeleteServerWideTaskOperation` and pass the name of the server-wide backup task you want to delete.

##### Example:

```csharp
// Delete a server-wide backup task by name
await store.Maintenance.Server.SendAsync(
    new DeleteServerWideTaskOperation("FullAndIncrementalBackup", OngoingTaskType.Backup));
```

---

### Managing backup operations

After defining a server-wide task, its derived database tasks start executing **backup operations** as scheduled.  
For any derived database task, you can:

- Trigger the **immediate execution** of a backup operation, outside of its task schedule.
- **Delay a backup operation** that the task has already started.
- **Abort a backup operation** that the task has already started.

#### Triggering an immediate backup operation

To back up a database immediately using a derived database task:

- Pass `PutServerWideBackupConfigurationCommand.GetTaskName` the server-wide task name,  
  to get the derived task name.
- Pass `GetOngoingTaskInfoOperation` the derived task name,  
  to get the derived task info.
- Pass `StartBackupOperation` the derived task ID,  
  to trigger an immediate backup.

##### Example:

```csharp
// Database name
var databaseName = "Products";

// Server-wide task name
var serverWideTaskName = "DailyBackup";

// Pass the server-wide task name to get the derived task name
var derivedTaskName = PutServerWideBackupConfigurationCommand.GetTaskName(serverWideTaskName);

// Pass the derived task name to get the derived task info
var derivedDatabaseTask = await store.Maintenance.ForDatabase(databaseName).SendAsync(
    new GetOngoingTaskInfoOperation(derivedTaskName, OngoingTaskType.Backup)) as OngoingTaskBackup;

// Ensure the derived task exists for the chosen database
if (derivedDatabaseTask == null)
{
    throw new InvalidOperationException($"The server-wide periodic backup task '{derivedTaskName}' " +
        $"is not found in database '{databaseName}'.");
}

// Get the TaskId of the derived task
long derivedDatabaseTaskId = derivedDatabaseTask.TaskId;

// Decide whether to run full or incremental backup
bool isFullBackup = true;

// Create backup immediately for the chosen database
Operation<StartBackupOperationResult> backupOperation = await store.Maintenance.ForDatabase(databaseName).SendAsync(
    new StartBackupOperation(isFullBackup, derivedDatabaseTaskId));
```

##### `StartBackupOperation`:

```csharp
public StartBackupOperation(bool isFullBackup, long taskId)
```

| Parameter | Type | Description |
| - | - | - |
| **isFullBackup** | `bool` | `true` - create a full backup<br />`false` - create an incremental backup |
| **taskId** | `long` | The ID of the periodic backup task to use when creating the backup. |

#### Delaying a running backup operation

To delay the execution of a **currently running** backup operation:

- Pass `PutServerWideBackupConfigurationCommand.GetTaskName` the server-wide task name,  
  to get the derived task name.
- Pass `GetOngoingTaskInfoOperation` the derived task name,  
  to get the derived task info.
- Ensure that the derived task exists on the chosen database (not `null`),  
  and there is a running backup operation (`OnGoingBackup` is not `null`).
- Pass `DelayBackupOperation` the operation ID and the delay duration to delay the backup operation.

##### Example:

```csharp
// The database name
var databaseName = "Products";

// Pass the server-wide task name to get the derived task name 
var derivedTaskName = PutServerWideBackupConfigurationCommand.GetTaskName(serverWideTaskName);

// Pass the derived task name to get the derived task info
var derivedTask = await store.Maintenance.ForDatabase(databaseName).SendAsync(
    new GetOngoingTaskInfoOperation(derivedTaskName, OngoingTaskType.Backup)) as OngoingTaskBackup;

// Ensure the derived task exists
if (derivedTask == null)
{
    throw new InvalidOperationException($"The server-wide periodic backup task '{derivedTaskName}' " +
        $"is not found in database '{databaseName}'.");
}

// Ensure there is a running backup operation
if (derivedTask.OnGoingBackup == null)
{
    throw new InvalidOperationException("No running backup operation to delay.");
}

// Delay duration
var delayDuration = TimeSpan.FromHours(1);

// Delay the running backup operation
await store.Maintenance.ForDatabase(databaseName).SendAsync(new DelayBackupOperation(
    derivedTask.OnGoingBackup.RunningBackupTaskId,
    delayDuration));
```

#### Aborting a running backup operation

- To abort a periodic backup that was started by its derived task **as scheduled**:

  - Pass `PutServerWideBackupConfigurationCommand.GetTaskName` the server-wide task name,  
    to get the derived task name.
  - Pass `GetOngoingTaskInfoOperation` the derived task name,  
    to get the derived task info.
  - Ensure that the derived task exists on the chosen database (not `null`),  
    and there is a running backup operation (`OnGoingBackup` is not `null`).
  - Pass `KillOperationCommand` the operation ID to abort the backup operation.

  **Example**:

  ```csharp
  var databaseName = "Products";

  // Pass the server-wide task name to get the derived task name
  var derivedTaskName = PutServerWideBackupConfigurationCommand.GetTaskName(serverWideTaskName);

  // Pass the derived task name to get the derived task info
  var derivedTask = await store.Maintenance.ForDatabase(databaseName).SendAsync(
      new GetOngoingTaskInfoOperation(derivedTaskName, OngoingTaskType.Backup)) as OngoingTaskBackup;

  // Ensure the derived task exists
  if (derivedTask == null)
  {
      throw new InvalidOperationException($"The server-wide periodic backup task '{derivedTaskName}' " +
          $"is not found in database '{databaseName}'.");
  }

  // Ensure there is a running backup operation
  if (derivedTask.OnGoingBackup == null)
  {
      throw new InvalidOperationException("No running backup operation to abort.");
  }

  // Abort the backup by killing the running operation 
  await store.Commands(databaseName).ExecuteAsync(
  new KillOperationCommand(derivedTask.OnGoingBackup.RunningBackupTaskId));
  ```

- To abort a backup that was triggered **manually** using `StartBackupOperation`:

  - Extract the backup operation ID from the result returned by `StartBackupOperation`.
  - Use the backup operation ID to abort the operation.
  - Also extract and use the responsible node tag to ensure that the operation is aborted on the correct cluster node.

  **Example:**

  ```csharp
  // Database name
  var databaseName = "Products";

  // Server-wide task name
  var serverWideTaskName = "DailyBackup";

  // Pass the server-wide task name to get the derived task name
  var derivedTaskName = PutServerWideBackupConfigurationCommand.GetTaskName(serverWideTaskName);

  // Pass the derived task name to get the derived task info
  var derivedDatabaseTask = await store.Maintenance.ForDatabase(databaseName).SendAsync(
      new GetOngoingTaskInfoOperation(derivedTaskName, OngoingTaskType.Backup)) as OngoingTaskBackup;

  // Ensure the derived task exists for the chosen database
  if (derivedDatabaseTask == null)
  {
      throw new InvalidOperationException($"The server-wide periodic backup task '{derivedTaskName}' " +
          $"is not found in database '{databaseName}'.");
  }

  // Get the TaskId of the derived task
  long derivedDatabaseTaskId = derivedDatabaseTask.TaskId;

  // Decide whether to run full or incremental backup
  bool isFullBackup = true;

  // Create backup immediately for the chosen database
  Operation<StartBackupOperationResult> backupOperation = await store.Maintenance.ForDatabase(databaseName).SendAsync(
      new StartBackupOperation(isFullBackup, derivedDatabaseTaskId));

  // Kill the running operation by id, routed to the owning node
  long backupOperationId = backupOperation.Id;
  string nodeTag = backupOperation.NodeTag;

  await store.Commands(databaseName).ExecuteAsync(
      new KillOperationCommand(backupOperationId, nodeTag));
  ```

---

> **Note**
>
> Note that after aborting the backup operation, you may need to **manually clean up**:
>
> - Partial **local** files, left while creating the backup.
> - Partial or temporary **remote** uploads.

## Syntax {#syntax}

### Methods

#### Server-wide task management

##### PutServerWideBackupConfigurationOperation

Creates or updates a server-wide periodic backup task.

```csharp
public PutServerWideBackupConfigurationOperation(ServerWideBackupConfiguration configuration)

```

Usage:

```csharp
PutServerWideBackupConfigurationResponse result = await store.Maintenance.Server.SendAsync(
    new PutServerWideBackupConfigurationOperation(configuration));

```

| Parameter | Type | Description |
| - | - | - |
| **configuration** | `ServerWideBackupConfiguration` | The server-wide backup configuration to create or update.<br />To update an existing task, retrieve the current configuration first (keeping its `TaskId` unchanged). |

| Return value | |
| - | - |
| `PutServerWideBackupConfigurationResponse` | Contains `Name` (`string`) - the name of the created or updated server-wide task,<br />and `RaftCommandIndex` (`long`). |

##### GetServerWideBackupConfigurationOperation

Retrieves a single server-wide backup configuration by name.

```csharp
public GetServerWideBackupConfigurationOperation(string name)

```

Usage:

```csharp
ServerWideBackupConfiguration config = await store.Maintenance.Server.SendAsync(
    new GetServerWideBackupConfigurationOperation(name));

```

| Parameter | Type | Description |
| - | - | - |
| **name** | `string` | The name of the server-wide backup task to retrieve. |

| Return value | |
| - | - |
| `ServerWideBackupConfiguration` | The server-wide backup configuration, or `null` if no task with the given name exists. |

##### GetServerWideBackupConfigurationsOperation

Retrieves all server-wide backup configurations.

```csharp
public GetServerWideBackupConfigurationsOperation()

```

Usage:

```csharp
ServerWideBackupConfiguration[] configs = await store.Maintenance.Server.SendAsync(
    new GetServerWideBackupConfigurationsOperation());

```

| Return value | |
| - | - |
| `ServerWideBackupConfiguration[]` | An array of all server-wide backup configurations.<br />`null` if no server-wide backup tasks exist. |

##### DeleteServerWideTaskOperation

Deletes a server-wide task by name, removing all its derived database tasks.

```csharp
public DeleteServerWideTaskOperation(string name, OngoingTaskType type)

```

Usage:

```csharp
await store.Maintenance.Server.SendAsync(
    new DeleteServerWideTaskOperation(name, OngoingTaskType.Backup));

```

| Parameter | Type | Description |
| - | - | - |
| **name** | `string` | The name of the server-wide task to delete. |
| **type** | `OngoingTaskType` | The type of the ongoing task.<br />Use `OngoingTaskType.Backup` for backup tasks. |

---

#### Operations

For syntax details on the operations used in the examples above to trigger, delay, and abort backup operations (`StartBackupOperation`, `DelayBackupOperation`, `KillOperationCommand`), see the [database backup operations syntax](https://docs.ravendb.net/7.2/backup/create/periodic-tasks/database-backup.md#operations).

---

### Classes

#### Backup configuration classes

##### ServerWideBackupConfiguration

**Server-wide backup configuration**

```csharp
class ServerWideBackupConfiguration : PeriodicBackupConfiguration, IServerWideTask
{
    string[] ExcludedDatabases
}
```

| Property | Type | Description |
| - | - | - |
| **ExcludedDatabases** | `string[]` | The list of databases excluded from the server-wide backup. |

##### PeriodicBackupConfiguration

**Periodic backup configuration**

```csharp
class PeriodicBackupConfiguration : BackupConfiguration
{
    string Name
    long TaskId
    bool Disabled
    string MentorNode
    bool PinToMentorNode
    RetentionPolicy RetentionPolicy
    DateTime? CreatedAt
    string FullBackupFrequency
    string IncrementalBackupFrequency
}
```

| Property | Type | Description |
| - | - | - |
| **Name** | `string` | The name of the periodic backup task. |
| **TaskId** | `long` | The unique identifier for the backup task. |
| **Disabled** | `bool` | Indicates whether the backup task is disabled. |
| **MentorNode** | `string` | The mentor node responsible for executing the backup task. When set for a server-wide backup task, this node is applied to all derived database tasks. If this node is not in the database group of a specific database, the cluster will automatically assign a node from that database's group as the responsible node for that database's derived task. |
| **PinToMentorNode** | `bool` | Determines if the backup task should always run on the mentor node. |
| **RetentionPolicy** | `RetentionPolicy` | The retention policy associated with the backup task. |
| **CreatedAt** | `DateTime?` | The timestamp when the backup task was created. |
| **FullBackupFrequency** | `string` | Frequency of full backup jobs in [cron](https://en.wikipedia.org/wiki/Cron) format. |
| **IncrementalBackupFrequency** | `string` | Frequency of incremental backup jobs in [cron](https://en.wikipedia.org/wiki/Cron) format.<br />If set to `null`, incremental backup will be disabled. |

##### BackupConfiguration

**Backup configuration**

```csharp
class BackupConfiguration
{
    BackupType BackupType
    BackupUploadMode BackupUploadMode
    SnapshotSettings SnapshotSettings
    BackupEncryptionSettings BackupEncryptionSettings
    int? MaxReadOpsPerSecond
    LocalSettings LocalSettings
    S3Settings S3Settings
    GlacierSettings GlacierSettings
    AzureSettings AzureSettings
    FtpSettings FtpSettings
    GoogleCloudSettings GoogleCloudSettings
}
```

| Property | Type | Description |
| - | - | - |
| **BackupType** | `BackupType` | Backup type (snapshot or logical backup) |
| **BackupUploadMode** | `BackupUploadMode` | Upload mode (via local storage or directly to destination) |
| **SnapshotSettings** | `SnapshotSettings` | Snapshot settings |
| **BackupEncryptionSettings** | `BackupEncryptionSettings` | Encryption settings |
| **MaxReadOpsPerSecond** | `int?` | Maximum number of read operations per second allowed during backup. |
| **LocalSettings** | `LocalSettings` | Local storage settings |
| **S3Settings** | `S3Settings` | Amazon S3 backup settings |
| **GlacierSettings** | `GlacierSettings` | Amazon Glacier backup settings |
| **AzureSettings** | `AzureSettings` | Azure backup settings |
| **FtpSettings** | `FtpSettings` | FTP-based backup settings |
| **GoogleCloudSettings** | `GoogleCloudSettings` | Google Cloud backup settings |

> **Note**
>
> For syntax details on all configuration classes, enums, and backup destination settings used in the properties above, see the [database backup syntax](https://docs.ravendb.net/7.2/backup/create/periodic-tasks/database-backup.md#classes).

## Creating and managing server-wide backup tasks via Studio {#creating-and-managing-server-wide-backup-tasks-via-studio}

### Creating a server-wide backup task

To create a periodic server-wide backup task:

- Open: **`Manage server` > `Server-wide tasks` > `Add a server-wide task`**

  ![Manage server view](https://docs.ravendb.net/assets/images/server-wide-task_manage-server-view-876b963f588d8e817341711bc616e25f.png)

- Pick `Server-wide periodic backup` to create your task.

  ![Create server-wide task](https://raw.githubusercontent.com/ravendb/docs/main/docs/backup/create/periodic-tasks/assets/server-wide-task_create-task.png)

- Define the backup configuration as explained in the [periodic database-backup task](https://docs.ravendb.net/7.2/backup/create/periodic-tasks/database-backup.md#a-defining-basic-task-options) article  
  and **exclude** any database that you do not want to schedule backups for.

  ![Task configuration](https://docs.ravendb.net/assets/images/server-wide-task_configuration-267cb7133e2484ec209b6522476d2fec.png)

  - **Exclude databases**

    ![Exclude database](https://docs.ravendb.net/assets/images/server-wide-task_configuration_exclude-database-83437777d1e28645e54088873f9754fb.png)

    By default, the server will create a derived database backup task and schedule a backup routine for **all databases on the server**.  
    To exclude databases from the backup, enable the **Exclude databases** option and select the databases you want to exclude.

  - **Set responsible node**

    You can select a cluster node to be responsible for all derived database backup tasks.  
    If no node is selected, the responsible node for each derived task is assigned automatically by the cluster.

    > **Note**
    >
    > If you select a responsible node for all databases, and this node is not in the database group of a specific database, the cluster will automatically assign a node from that database's group as the responsible node for that database's derived task.

  - **Backups storage**

    ![Storage settings](https://docs.ravendb.net/assets/images/database-periodic_storage_local-215871ae338bcc0311b799c039b69be4.png)

    Define a root storage location for backups created by all derived database tasks.  
    Each database task will automatically store its backups in a [subfolder named after the database](https://docs.ravendb.net/7.2/backup/overview.md#backups-storage), under the root storage location.

    e.g.,

    - for a local folder, define `D:\RavenBackups` as the root storage location.  
      Backups for a database named `Products` will be stored in `D:\RavenBackups\Products`.
    - for an FTP destination, define `ftp://myserver.com/backups` as the root storage location.  
      Backups for a database named `Products` will be sent to `ftp://myserver.com/backups/Products`.
    - For an `S3` destination, define `ravendb/backups` as the root storage location.  
      Backups for a database named `Products` will be sent to `ravendb/backups/Products`.

  - **Encryption settings**

    - When the database is **unencrypted**:
      - **Snapshots** are **always unencrypted**.
      - **Logical backups** are handled according to the server-wide task encryption settings:
        - **Disable** encryption to produce unencrypted backups.
        - **Enable** encryption and **provide an encryption key** to encrypt the backups.

    - When the database is **encrypted**:  
      **Snapshots** and **logical backups** are both **always encrypted using the database key**.
      > **Note**
      >
      > Note that **logical backups** behave differently in this respect when created by a server-wide task vs a regular database backup task.  
      > [See the server-wide encryption section in the overview for additional details.](https://docs.ravendb.net/7.2/backup/overview.md#server-wide-encryption-settings)

- Save the server-wide task.

  ![Save or Cancel](https://raw.githubusercontent.com/ravendb/docs/main/docs/backup/create/periodic-tasks/assets/database-periodic_define-task_save-or-cancel.png)

  **Save** to store the task and create the derived database tasks,  
  or **Cancel** to discard the server-wide configuration.

---

### Managing server-wide tasks

#### Managing the parent server-wide task

To manage a saved server-wide task, open the **Manage server** view and select **Server-wide tasks**.

![Backups view with tasks](https://docs.ravendb.net/assets/images/server-wide-task_manage-server-view_with-tasks-658ea31b8858d39d467ac4ce9b5facdb.png)

You can:

- **Edit** tasks.
- **Enable** or **disable** tasks and all their derived database tasks.
- **Delete** tasks and all their derived database tasks.
- **View** task details, including -
  - Whether backups are **encrypted**.
  - Where backups are **stored**.
  - The **retention period** for stored backups.
  - Which databases are **excluded** from the backup.

---

### Managing derived database tasks

To manage a database backup task derived from a server-wide task:

- Select a database from the **Databases** view.  
  ![Select database](https://docs.ravendb.net/assets/images/server-wide-task_select-database-44664a4ec76c5799f2a2babd11c1e4bf.png)
- Open the **Tasks** view and select **Backups**.  
  The names of backup tasks derived from a server-wide configuration are automatically given a **Server Wide Backup** prefix.

  ![Server-wide derived tasks](https://docs.ravendb.net/assets/images/server-wide-task_database-backups_derived-tasks-9d4ad20fc090ed79d3da66f28fca5e6d.png)

  You can:

  - **Enable** or **disable** the database task.
  - **Create a backup immediately** for this database.
  - **View task details**, including:
    - The node responsible for the backup task.
    - The node where the task was last executed.
    - Whether backups are **encrypted**.
    - Where backups are **stored**.
    - Last and next scheduled backups.
    - The **retention period** for stored backups.

  > **Note**
  >
  > **Editing** and **deleting** the task are available only from the [parent server-wide task](#managing-the-parent-server-wide-task).

---

#### Running a backup operation immediately

You can trigger the immediate creation of a backup for the database, without waiting for the next scheduled backup.

- Expand the task details bar as seen above, and click **Backup now**.
- You will be given the option to create a full or an incremental backup immediately, based on the server-wide task configuration.
  ![Select scope](https://raw.githubusercontent.com/ravendb/docs/main/docs/backup/create/periodic-tasks/assets/server-wide-task_backup-now_select-scope.png)

---

### Delaying or aborting a running backup operation

To delay or abort a running backup operation (e.g., when a backup takes longer than expected or you need to free up server resources), open the notifications center and find the notification added for the running backup operation.

- To **abort** the operation, click the notification's **Abort** button.  
  ![Abort backup](https://docs.ravendb.net/assets/images/database-periodic_abort-5cf871de87bd78cc1fbc1e800678f5f1.png)

- To **delay** the operation:
  - Click the notification's **Details** button.  
    ![Backup operation notification](https://raw.githubusercontent.com/ravendb/docs/main/docs/backup/create/periodic-tasks/assets/database-periodic_details-button.png)
  - When the operation details view opens, click the **Delay backup** button at the bottom and select the delay duration. The backup operation will resume when the set period elapses.  
    ![Delay backup](https://docs.ravendb.net/assets/images/database-periodic_delay-a2e8d4e1b7cc47093d4f2f3074093037.png)
