Sign inSign up

solucetechnologies/agent-portabase

By solucetechnologies

•Updated 9 months ago

Databases Backup and Restore software.

Developer tools
Databases & storage
Monitoring & observability
1

1.3K

solucetechnologies/agent-portabase repository overview


Logo ⁠
⁠Portabase Agent

Free, open-source, and self-hosted solution for automated backup and restoration of your database instances.

License: MIT Docker Pulls Platform

PostgreSQL PostgreSQL MySQL MariaDB Self Hosted Open Source

Documentation⁠ • Demo⁠ • Installation⁠ • Report Bug⁠ • Request Feature⁠


⁠✨ About The Project

Portabase Agent is the agent service use with Portabase Server. This service is for backup/restore db instances. Portabase Server⁠

⁠Built With
  • Python
  • Redis
  • Celery
  • Docker

⁠🚀 Getting Started

⁠Installation

You have 3 ways to install Portabase Agent:

  • Automated CLI (recommended) - details⁠
  • Docker Compose setup - details⁠
  • Kubernetes with Helm (soon)

Ensure Docker is installed on your machine before getting started.

⁠Docker Compose Setup

Create a docker-compose.yml file with the following configuration:

name: agent-portabase

services:
  app:
    container_name: agent-portabase
    restart: always
    image: solucetechnologies/agent-portabase:latest
    volumes:
      # Mount the DB config file
      - ./databases.json:/app/src/data/config/config.json
      # - ./databases.toml:/app/src/data/config/config.toml
    environment:
      TZ: "Europe/Paris"
      # DATABASES_CONFIG_FILE: "config.toml" if you use .toml config file. By default, it's "config.json"
      EDGE_KEY: "<Get your edge key from your dashboard>"
    networks:
      - portabase

  db:
    image: postgres:17-alpine
    networks:
      - portabase
      - default
    ports:
      - "5430:5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=<your_database>
      - POSTGRES_USER=<database_user>
      - POSTGRES_PASSWORD=<database_password>

volumes:
  postgres-data:

networks:
  portabase:
    name: portabase_network
    external: true

Then run:

docker compose up -d
⁠Locally (Development)
  1. Clone the repository
    git clone https://github.com/Portabase/agent-portabase
    
  2. Start the project
    docker compose up 
    

⁠🔑 Config File

You can configure your database connections by adding a config file. The software supports both JSON and **TOML ** formats, so you can choose the format that best fits your workflow.

Multiple databases can be connected through the same agent, which is useful for managing development, staging, and production environments.

⁠JSON Example

Create a database.json file with your database information:

{
  "databases": [
    {
      "name": "Test database 1",
      "database": "devdb",
      "type": "postgresql",
      "username": "devuser",
      "password": "changeme",
      "port": 5432,
      "host": "localhost",
      "generatedId": "16678159-ff7e-4c97-8c83-0adeff214681"
    },
    {
      "name": "Test database 2",
      "database": "mariadb",
      "type": "mysql",
      "username": "mariadb",
      "password": "changeme",
      "port": 3306,
      "host": "localhost",
      "generatedId": "16678124-ff7e-4c97-8c83-0adeff214681"
    }
  ]
}
⁠TOML Example

Create a database.json file with your database information:

[[databases]]
name = "Test database 1"
database = "devdb"
type = "postgresql"
username = "devuser"
password = "changeme"
port = 5432
host = "localhost"
generatedId = "16678159-ff7e-4c97-8c83-0adeff214681"

[[databases]]
name = "Test database 1"
database = "mariadb"
type = "mysql"
username = "mariadb"
password = "changeme"
port = 3306
host = "localhost"
generatedId = "16678124-ff7e-4c97-8c83-0adeff214681"

✅ Both JSON and TOML formats are fully supported.

For generatedId, you will need to generate it yourself using the UUID V4 format⁠

⁠📦 Database Seed (development)

Using Docker

⁠For postgres
docker exec -i -e PGPASSWORD=<password> <container_name> psql -U <USER> -d <DATABASE> < ./scripts/seed.sql
⁠For mysql

Install the client cli before

mysql -h 127.0.0.1 -P <port> -u <username> -p<password> <database_name> < ./scripts/seed-mysql.sql

⁠🤝 Contributing

Contributions are welcome and appreciated! Here's how to get started:

  1. Fork the repository
  2. Create a new branch:
    git checkout -b features/your-feature
    
  3. Commit your changes:
    git commit -m "Add YourFeature"
    
  4. Push to the branch:
    git push origin features/your-feature
    
  5. Open a pull request
⁠Top contributors:
contrib.rocks image ⁠

⁠📄 License

Distributed under the Apache License. See LICENSE.txt for more information.


⁠🙏 Acknowledgments

Thanks to all contributors and the open-source community!

Give the project a ⭐ if you like it!

Tag Summary

No tags have been pushed to this repository yet.