broken db migration from 2021 #4948

Closed
opened 2026-02-05 09:28:47 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @manicmarvin on GitHub (Sep 17, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

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

Originally created by @manicmarvin on GitHub (Sep 17, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### 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
OVERLORD added the 🐕 Support label 2026-02-05 09:28:47 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 17, 2024):

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 on GitHub (Sep 17, 2024): 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?
Author
Owner

@ssddanbrown commented on GitHub (Oct 3, 2024):

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

@ssddanbrown commented on GitHub (Oct 3, 2024): Since there's been no further follow up on this I'll go ahead and close it off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4948