BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.46k stars 1.94k forks source link

broken db migration from 2021 #5203

Closed manicmarvin closed 1 month ago

manicmarvin commented 2 months ago

Attempted Debugging

Searched GitHub Issues

Describe the Scenario

I have a very old version of bookstack that has not been updated for years, I am now unable to update it because there were clearly unresolved migration issues in some past upgrade in 2020 or 2021 that throw errors during migration.

on running php artisan migrate I get:


Migrating: 2020_09_27_210528_create_deletions_table
Migrated:  2020_09_27_210528_create_deletions_table (0.72 seconds)
Migrating: 2020_11_07_232321_simplify_activities_table
Migrated:  2020_11_07_232321_simplify_activities_table (1.36 seconds)
Migrating: 2020_12_30_173528_add_owned_by_field_to_entities
Migrated:  2020_12_30_173528_add_owned_by_field_to_entities (1.61 seconds)
Migrating: 2021_01_30_225441_add_settings_type_column
Migrated:  2021_01_30_225441_add_settings_type_column (0.13 seconds)
Migrating: 2021_03_08_215138_add_user_slug
Migrated:  2021_03_08_215138_add_user_slug (0.83 seconds)
Migrating: 2021_05_15_173110_create_favourites_table
Migrated:  2021_05_15_173110_create_favourites_table (0.44 seconds)
Migrating: 2021_06_30_173111_create_mfa_values_table
Migrated:  2021_06_30_173111_create_mfa_values_table (0.45 seconds)
Migrating: 2021_07_03_085038_add_mfa_enforced_to_roles_table
Migrated:  2021_07_03_085038_add_mfa_enforced_to_roles_table (0.15 seconds)
Migrating: 2021_08_28_161743_add_export_role_permission
Migrated:  2021_08_28_161743_add_export_role_permission (0.02 seconds)
Migrating: 2021_09_26_044614_add_activities_ip_column
Migrated:  2021_09_26_044614_add_activities_ip_column (0.13 seconds)

   Symfony\Component\Debug\Exception\FatalThrowableError  : Class 'AddIndexForUserIp' not found

  at /var/www/wiki.asia.apc.org/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:453
    449|     public function resolve($file)
    450|     {
    451|         $class = Str::studly(implode('_', array_slice(explode('_', $file), 4)));
    452|
  > 453|         return new $class;
    454|     }
    455|
    456|     /**
    457|      * Get all of the migration files in a given path.

Exact BookStack Version

v0.30.4

Log Content

No response

Hosting Environment

Debian GNU/Linux 12 (bookworm) PHP 7.4-fpm running, several versions installed upto 8.3 Mariadb: 10.11.6-MariaDB-0+deb12u1 Debian 12

ssddanbrown commented 2 months ago

Hi @manicmarvin, Before anything please ensure you have full system backups if possible and backups of your BookStack database and files.

Specifically how are you upgrading from v0.30.4? What exact steps have you performed in this operation?

ssddanbrown commented 1 month ago

Since there's been no further follow up on this I'll go ahead and close it off.