coolify icon indicating copy to clipboard operation
coolify copied to clipboard

feat: add ServiceDatabase restore/import support

Open murataslan1 opened this issue 3 months ago • 2 comments

Summary

Add support for restoring/importing backups in ServiceDatabase (Docker Compose databases).

Changes

  • Add ServiceDatabase case in buildRestoreCommand() method
  • Handle ServiceDatabase container naming in getContainers() (uses name-service.uuid format)
  • Support PostgreSQL, MySQL, MariaDB, MongoDB detection via databaseType()
  • Mark unsupported ServiceDatabase types (Redis, KeyDB, Dragonfly, Clickhouse)
  • Update updatedDumpAll() to handle ServiceDatabase dump-all mode

Technical Details

The implementation uses the existing ServiceDatabase::databaseType() method to detect the database type and build the appropriate restore command, following the same pattern as standalone databases.

Testing

  • [ ] Test with PostgreSQL ServiceDatabase
  • [ ] Test with MySQL ServiceDatabase
  • [ ] Test with MariaDB ServiceDatabase
  • [ ] Test with MongoDB ServiceDatabase

Related Issue

/claim #7529

Demo Video

(Will be added after testing)

murataslan1 avatar Dec 09 '25 07:12 murataslan1

The target branch has to be next not v4.x

ShadowArcanist avatar Dec 09 '25 08:12 ShadowArcanist

Application composes don't have the UI to support imports and backups at the moment. So just enabling the functionality in the backend won't be enough. The user needs the necessary UI to configure them as well.

Cinzya avatar Dec 09 '25 13:12 Cinzya

Thanks for the feedback! I've added the Import Backup UI to the ServiceDatabase configuration page for supported database types (PostgreSQL, MySQL, MariaDB, MongoDB).

The import functionality uses the existing Import Livewire component. Full backup system (scheduled backups, backup execution views) would require more work - let me know if that's needed for this PR or should be a separate issue.

murataslan1 avatar Dec 12 '25 08:12 murataslan1