A Laravel-based application to manage database backups
- PHP 8.2 or higher
- PostgreSQL installed and accessible
- Scheduler Backup: Schedule automatic backups of your PostgreSQL database at specified intervals.
- Automatic Prune Backup: Automatically prune old backups based on your desired retention period (e.g., 1 day, 2 days, etc.).
- Store Backup to SFTP: Easily store your backups to a remote SFTP server for added security and offsite storage.
-
Clone the repository:
git clone https://github.com/muhammadardie/laravel-database-backup.git
-
Navigate to the project directory:
cd laravel-database-backup
-
Install dependencies:
composer install
-
Copy the environment file:
cp .env.example .env
-
Generate the application key:
php artisan key:generate
-
Create a database and configure the
.env
file:-
Add your database configuration details in the
.env
file:DB_CONNECTION=pgsql DB_HOST=127.0.0.1 DB_PORT=5432 DB_DATABASE=your_database_name DB_USERNAME=your_database_user DB_PASSWORD=your_database_password
-
-
Specify the paths for
pg_dump
andpsql
in your.env
file:PG_DUMP_PATH=/usr/pgsql-16/bin/pg_dump PSQL_PATH=/usr/pgsql-16/bin/psql
-
Set permissions for the
public
,storage
andbootstrap/cache
directories to allow the web server user to write (public
folder used to store temporary database backups and user avatars):chown -R nginx:nginx public storage bootstrap/cache chmod -R 775 public storage bootstrap/cache
-
Run the migrations and seed the database:
php artisan migrate --seed
-
Start the application:
php artisan serve
Access the app at http://localhost:8000/.
- URL: https://ldbackup.muhammadardie.tech/
- Email: local@mail.com
- Password: 123456
- The application is still in development and currently only supports PostgreSQL.
- Support for additional database engines (e.g., MySQL, SQLite).
- Enhanced UI for managing backups.
- Integration with more cloud storage solutions for remote backups.
Contributions are welcome! If you have suggestions for improvements or new features, please create an issue or submit a pull request.
This project is licensed under the MIT License. You are free to use, modify, and distribute this software, provided that the original license is included with any substantial portions of the software.