Open source Google Workspace backup solution.
Project description
gwbackupy: Google Workspace™ backup and restore solution.
What is it?
Google Workspace™ backup and restore solution. Gwbackupy is open source and written in python.
Currently supported Gmail messages only.
Why?
Due to gmvault limitations:
- is still abandoned (??)
- authentication method is not usable in Google Workspace wide
- designed only for gmail messages
- only supports IMAP protocol (slow and limited speed)
Functionality
-
Run from CLI or run directly from python code
-
Authentication
- OAUTH for free or paid plans (not recommended for paid plans)
- Service account file (JSON or P12) for paid plans (can be configured to access all accounts in workspace.)
-
Version controlled storage for new and deleted items.
Allows to restore specific moments without using an external snapshot system (eg. zips, file system with snapshot)
-
Dry mode (not write to local storage and not modify on server)
-
Uses API communication (no need for special IMAP and other settings)
-
Gmail
-
full backup (download all messages)
-
full backup continuously (periodically rerunning)
Scanning the full mailbox, but download only the new messages and mark the deleted messages.
-
full restore to an empty mailbox (same or other account)
-
restore deleted message in specified interval
-
Paid plans are the following: here. Google One or additional storages are not considered as paid plans
Requirements
pip
orpython3
- Google Cloud account and own created access files. This software does not contain access files, this is for security reasons.
Install
The easiest way for installing:
pip install gwbackupy
Instructions
Usage
Example usage Gmail
Backup run in CLI:
gwbackupy \
--service-account-key-filepath <service-acount-json-key-file> \
--batch-size 5 \
gmail backup \
--email <mailbox email address>
Restore run in CLI:
gwbackupy \
--service-account-key-filepath <service-acount-json-key-file> \
--batch-size 5 \
gmail restore \
--add-label "backup-restore-1231" \
--add-label "more-restore-label" \
--filter-date-from <date or datetime eg. "2023-01-01"> \
--filter-date-to <date or datetime eg. "2023-02-02 03:00:00"> \
--restore-deleted \
--email <source backup mailbox email address> \
--to-email <destination mailbox email address> # If you want to a different destination account
Backup run from python code:
from gwb.gmail import Gmail
from gwb.storage.file_storage import FileStorage
storage = FileStorage('./data/email@example.co')
gmail = Gmail(email='email@example.com',
service_account_file_path='xx.json',
batch_size=3,
storage=storage)
if gmail.backup():
print('Yeah!')
else:
print(':(')
Contributing
...
Changelog
The changes are contained in CHANGELOG.md.
About
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for gwbackupy-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fca454692c9a6ca5063df2758f0143e8e7b59fe169efa4a0be486c09eead1dbe |
|
MD5 | 8bdead0d5819204da1f213770fda39b6 |
|
BLAKE2b-256 | f0ef40e20265209435bbd55b4786e0d56f4618f56187880b6a05a8b5d2f0bcb5 |