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
Please use the [GitHub issue tracker](https://github.com/gooddata/gooddata-python-sdk/issues) to submit bugs
@@ -70,3 +71,159 @@ or request features.
70
71
71
72
See [Github releases](https://github.com/gooddata/gooddata-python-sdk/releases) for released versions
72
73
and a list of changes.
74
+
=======
75
+
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
76
+
77
+
## Backup and restore of workspaces
78
+
The backup and restore module allows you to create snapshots of GoodData Cloud workspaces and restore them later. This is useful for:
79
+
80
+
- Creating backups before major changes
81
+
- Migrating workspaces between environments
82
+
- Disaster recovery scenarios
83
+
- Copying workspace configurations
84
+
85
+
### Backup
86
+
87
+
The module supports three backup modes:
88
+
89
+
1.**List of workspaces** - Backup specific workspaces by providing a list of workspace IDs
90
+
2.**Workspace hierarchies** - Backup a workspace and all its direct and indirect children
91
+
3.**Entire organization** - Backup all workspaces in the organization
92
+
93
+
Each backup includes:
94
+
- Workspace declarative model (logical data model, analytics model, permissions)
95
+
- User data filters
96
+
- Filter views
97
+
- Automations
98
+
99
+
#### Storage Options
100
+
101
+
Backups can be stored in:
102
+
-**Local storage** - Save backups to a local directory
103
+
-**S3 storage** - Upload backups to an AWS S3 bucket
104
+
105
+
#### Basic Usage
106
+
107
+
```python
108
+
import os
109
+
from pathlib import Path
110
+
111
+
from gooddata_pipelines import BackupManager
112
+
from gooddata_pipelines.backup_and_restore.models.storage import (
113
+
BackupRestoreConfig,
114
+
LocalStorageConfig,
115
+
StorageType,
116
+
)
117
+
from gooddata_pipelines.logger.logger import LogObserver
118
+
119
+
# Optionally, subscribe a standard Python logger to the LogObserver
120
+
import logging
121
+
logger = logging.getLogger(__name__)
122
+
LogObserver().subscribe(logger)
123
+
124
+
# Configure backup storage
125
+
config = BackupRestoreConfig(
126
+
storage_type=StorageType.LOCAL,
127
+
storage=LocalStorageConfig(),
128
+
batch_size=10, # Number of workspaces to process in one batch
129
+
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:
206
+
```csv
207
+
workspace_id
208
+
workspace1
209
+
workspace2
210
+
workspace3
211
+
```
212
+
213
+
#### Configuration Options
214
+
215
+
The BackupRestoreConfig class accepts the following parameters:
216
+
-`storage_type` - Type of storage (StorageType.LOCAL or StorageType.S3)
217
+
-`storage` - Storage-specific configuration (LocalStorageConfig or S3StorageConfig)
218
+
-`batch_size` (optional, default: 10) - Number of workspaces to process in one batch
219
+
-`api_calls_per_second` (optional, default: 10) - Rate limit for API calls to avoid throttling
220
+
-`api_page_size` (optional, default: 500) - Page size for paginated API calls
221
+
222
+
223
+
#### Error Handling and Retries
224
+
225
+
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.
226
+
Restore
227
+
228
+
Note: Restore functionality is currently in development.
0 commit comments