Seamless Docker Swarm Backup & Migration Suite
Key Features • Quick Start • Documentation • Contributing • Support
SwarmVault is a powerful, backup and migration tool for Docker Swarm environments. It provides seamless backup and restoration of your entire Docker infrastructure, including Portainer stacks, volumes, and Swarm configurations.
🔄 Complete Environment Backup
- Automated Portainer stack preservation
- Docker volume data protection
- Swarm configuration safeguarding
- Network settings preservation
🚀 Easy Migration
- One-command backup creation
- Simplified restoration process
- Cross-server migration support
- Minimal downtime
🛡️ Enterprise Ready
- Detailed logging
- Error handling
- Remote sync capabilities
- Compression for storage efficiency
- Python 3.8 or higher
- Docker Swarm environment
- Portainer (optional)
# Clone the repository
git clone https://github.com/hipnologo/swarmvault.git
cd swarmvault
# Make the script executable
chmod +x swarmvault.py
# Install dependencies
pip install -r requirements.txt
# Create a backup
./swarmvault.py
# Backup with custom directory
./swarmvault.py --backup-dir /path/to/backups
# Backup and sync to remote server
./swarmvault.py --remote-host user@server --sync-to /remote/backup/path
Option | Description | Default |
---|---|---|
--backup-dir |
Local backup directory | /opt/swarmvault/backups |
--remote-host |
Remote host for backup operations | None |
--sync-to |
Remote path to sync backups to | None |
SwarmVault creates a comprehensive backup including:
-
Portainer Stacks
- Stack configurations
- Docker compose files
- Service definitions
-
Docker Volumes
- Volume data
- Volume metadata
- Compressed archives
-
Swarm Configuration
- Swarm settings
- Network configurations
- Node information
swarmvault-backup-20240130_123456.tar.gz
├── portainer/
│ └── stacks/
│ ├── stack1.json
│ └── stack1-compose.yml
├── volumes/
│ └── volume1.tar.gz
└── swarm/
├── swarm-config.json
└── network-configs/
-
Prepare Environment
tar -xzf swarmvault-backup-*.tar.gz
-
Restore Volumes
# Script automatically handles volume restoration ./swarmvault.py --restore backup-archive.tar.gz
-
Deploy Stacks
# Automatic stack deployment ./swarmvault.py --restore-stacks backup-archive.tar.gz
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Docker community for inspiration and support
- All contributors who participate in this project
- Python community for excellent tools and libraries
- Create an Issue for bug reports
- Start a Discussion for questions
- See our Wiki for detailed documentation