You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ready-made scripts covering the basic use cases can be found here in the [GoodData Productivity Tools](https://github.com/gooddata/gooddata-productivity-tools) repository.
66
+
67
+
## Backup and Restore of Workspaces
68
+
69
+
The backup and restore module allows you to create snapshots of GoodData Cloud workspaces and restore them later. This is useful for:
70
+
71
+
- Creating backups before major changes
72
+
- Migrating workspaces between environments
73
+
- Disaster recovery scenarios
74
+
- Copying workspace configurations
75
+
76
+
### Backup
77
+
78
+
The module supports three backup modes:
79
+
80
+
1.**List of workspaces** - Backup specific workspaces by providing a list of workspace IDs
81
+
2.**Workspace hierarchies** - Backup a workspace and all its direct and indirect children
82
+
3.**Entire organization** - Backup all workspaces in the organization
83
+
84
+
Each backup includes:
85
+
- Workspace declarative model (logical data model, analytics model, permissions)
86
+
- User data filters
87
+
- Filter views
88
+
- Automations
89
+
90
+
#### Storage Options
91
+
92
+
Backups can be stored in:
93
+
-**Local storage** - Save backups to a local directory
94
+
-**S3 storage** - Upload backups to an AWS S3 bucket
95
+
-**Azure Blob Storage** - Upload backups to Azure Blob Storage
96
+
97
+
#### Basic Usage
98
+
99
+
```python
100
+
import os
101
+
from pathlib import Path
102
+
103
+
from gooddata_pipelines import BackupManager
104
+
from gooddata_pipelines.backup_and_restore.models.storage import (
105
+
BackupRestoreConfig,
106
+
LocalStorageConfig,
107
+
StorageType,
108
+
)
109
+
from gooddata_pipelines.logger.logger import LogObserver
110
+
111
+
# Optionally, subscribe a standard Python logger to the LogObserver
112
+
import logging
113
+
logger = logging.getLogger(__name__)
114
+
LogObserver().subscribe(logger)
115
+
116
+
# Configure backup storage
117
+
config = BackupRestoreConfig(
118
+
storage_type=StorageType.LOCAL,
119
+
storage=LocalStorageConfig(),
120
+
batch_size=10, # Number of workspaces to process in one batch
121
+
api_calls_per_second=10, # Rate limit for API calls
When providing workspace IDs via a CSV file, the file should have a `workspace_id` column:
230
+
231
+
```csv
232
+
workspace_id
233
+
workspace1
234
+
workspace2
235
+
workspace3
236
+
```
237
+
238
+
#### Configuration Options
239
+
240
+
The `BackupRestoreConfig` class accepts the following parameters:
241
+
-`storage_type` - Type of storage (`StorageType.LOCAL`, `StorageType.S3`, or `StorageType.AZURE`)
242
+
-`storage` - Storage-specific configuration (`LocalStorageConfig`, `S3StorageConfig`, or `AzureStorageConfig`)
243
+
-`batch_size` (optional, default: 10) - Number of workspaces to process in one batch
244
+
-`api_calls_per_second` (optional, default: 10) - Rate limit for API calls to avoid throttling
245
+
-`api_page_size` (optional, default: 500) - Page size for paginated API calls
246
+
247
+
#### Error Handling and Retries
248
+
249
+
The backup process includes automatic retry logic with exponential backoff. If a batch fails, it will retry up to 3 times before failing completely. Individual workspace errors are logged but don't stop the entire backup process.
250
+
251
+
### Restore
252
+
253
+
Note: Restore functionality is currently in development.
254
+
65
255
## Bugs & Requests
66
256
67
-
Please use the [GitHub issue tracker](https://github.com/gooddata/gooddata-python-sdk/issues) to submit bugs
68
-
or request features.
257
+
Please use the [GitHub issue tracker](https://github.com/gooddata/gooddata-python-sdk/issues) to submit bugs or request features.
69
258
70
259
## Changelog
71
260
72
-
See [Github releases](https://github.com/gooddata/gooddata-python-sdk/releases) for released versions
73
-
and a list of changes.
261
+
See [GitHub releases](https://github.com/gooddata/gooddata-python-sdk/releases) for released versions and a list of changes.
0 commit comments