Skip to content

Feat/Add auto backup and manual backup functionality to docker-compose.yaml#151

Merged
chamikaJ merged 7 commits intoWorklenz:developmentfrom
kithmina1999:feat/docker-db-backup
Jun 23, 2025
Merged

Feat/Add auto backup and manual backup functionality to docker-compose.yaml#151
chamikaJ merged 7 commits intoWorklenz:developmentfrom
kithmina1999:feat/docker-db-backup

Conversation

@kithmina1999
Copy link
Copy Markdown
Contributor

No description provided.

- Add backup.sh script for manual PostgreSQL database backups
- Update .gitignore to exclude pg_backups directory
- Modify docker-compose.yml to include backup service and volume mounts
- Add init.sh script for automated database initialization with backup restoration
- Rename init.sh to 00_init.sh for better ordering
- Format docker-compose command for better readability
- Add comprehensive database initialization script with backup restoration
- Implement proper migration handling with schema_migrations table
- Fix shell script syntax in db service command by using proper quoting and loop structure
- Clean up indentation and formatting in both db and db-backup services
- Ensure consistent command structure while maintaining the same functionality
The command for the postgres service was restructured to:
1. Use more readable multi-line formatting
2. Replace the find -exec with a more efficient for loop
3. Maintain the same functionality while improving maintainability
- Rename init script from init.sh to 00_init.sh for better ordering
- Rewrite database initialization script to support backup restoration
- Add proper migration handling with schema_migrations table
- Fix indentation and quoting issues in docker-compose.yml
- Remove old 00-init-db.sh script as it's replaced by new implementation
The previous version used $$ for variable expansion which doesn't work in this context. Changed to single $ for proper shell variable expansion in the database backup command.
The command was using incorrect quote escaping which could cause issues with variable expansion and file deletion. Fixed by using single quotes for the outer string and proper escaping for date command substitution.
@kithmina1999
Copy link
Copy Markdown
Contributor Author

need to run this command to give permissions to run init.sh script
chmod +x ./worklenz-backend/database/00_init.sh
and also run below commadn to turn init.sh into Unix line endings from CRLF
dos2unix ./worklenz-backend/database/init.sh

@chamikaJ chamikaJ merged commit 9c7fad7 into Worklenz:development Jun 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants