exolnet/laravel-db-upgrade

Artisan command to migrate an existing production database structure to use Laravel migrations
1,257
Install
composer require exolnet/laravel-db-upgrade
Latest Version:v1.11.0
PHP:^8.3
License:MIT
Last Updated:Sep 18, 2026
Links: GitHub  ·  Packagist
Maintainer: exolnet

laravel-db-upgrade

Latest Stable Version Software License Build Status Total Downloads

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

  1. Create migrations to obtain your current database structure;
  2. Configure last_migration_for_upgrade to points to the last migration that represent your current database structure;
  3. Optionally, you can add migrations to update your old structure;
  4. Run the php artisan db:upgrade command.

The db:upgrade command will perform the following actions:

  1. Backup your data;
  2. Run your migrations up to the last_migration_for_upgrade migration;
  3. Restore your data;
  4. 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

exolnet/laravel-status

The eXolnet Laravel Status package.

56,412 0
exolnet/laravel-translation

The eXolnet Laravel Translation package.

32,669 3
exolnet/laravel-sqlite-fluent-drop-foreign

Add a fluent dropForeign when using sqlite database

133,927 12
exolnet/laravel-backup-database

Expend laravel-backup by adding a simple command to backup a database.

49,274 0
exolnet/laravel-envoy

Automated deployment template for Laravel Envoy based on Capistrano.

18,122 23