exolnet/laravel-db-upgrade
| Install | |
|---|---|
composer require exolnet/laravel-db-upgrade |
|
| Latest Version: | v1.11.0 |
| PHP: | ^8.3 |
| Laravel: | 12 · 13 |
| Older releases: | 6 – 11 |
| License: | MIT |
| Last Updated: | Sep 18, 2026 |
| Links: | GitHub · Packagist |
laravel-db-upgrade
Artisan command to migrate an existing production database structure to use Laravel migrations
Installation
Require this package with composer:
composer require exolnet/laravel-db-upgrade
The package will automatically register its service provider.
Publish the config file to config/db-upgrade.php using:
php artisan vendor:publish --provider="Exolnet\DbUpgrade\DbUpgradeServiceProvider"
Review and update the default configuration according to your use case (see Usage section for more information).
Usage
- Create migrations to obtain your current database structure;
- Configure
last_migration_for_upgradeto points to the last migration that represent your current database structure; - Optionally, you can add migrations to update your old structure;
- Run the
php artisan db:upgradecommand.
The db:upgrade command will perform the following actions:
- Backup your data;
- Run your migrations up to the
last_migration_for_upgrademigration; - Restore your data;
- Run remaining migration.
Testing
To run the phpUnit tests, please use:
composer test
Contributing
Please see CONTRIBUTING and CODE OF CONDUCT for details.
Security
If you discover any security related issues, please email security@exolnet.com instead of using the issue tracker.
Credits
License
Copyright © eXolnet. All rights reserved.
This code is licensed under the MIT license. Please see the license file for more information.
Related Packages
Add a fluent dropForeign when using sqlite database
Expend laravel-backup by adding a simple command to backup a database.
Automated deployment template for Laravel Envoy based on Capistrano.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.11.0 | ^8.3 | ^12.0| | MIT | |
| v1.10.0 | ^8.2 | ^11.0| | MIT | |
| v1.9.0 | ^8.2 | ^11.0| | MIT | |
| v1.8.0 | ^8.2 | ^11.0| | MIT | |
| v1.7.0 | ^8.1 | ^10.0| | MIT | |
| v1.6.0 | ^8.0 | ^9.0| | MIT | |
| v1.5.0 | ^8.0 | ^8.0| | MIT | |
| v1.4.0 | ^7.3| | ^8.0| | MIT | |
| v1.3.0 | ^7.3| | ^6.0| | MIT | |
| v1.2.0 | ^7.2 | ^6.0| | MIT | |
| v1.1.0 | ^7.2 | ^6.0| | MIT | |
| v1.0.0 | ^7.2 | ^6.0 | MIT |