Upgrade from v0.30.4 to the latest version #5411

Open
opened 2026-02-05 10:02:46 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @mariaczi on GitHub (Aug 25, 2025).

Describe the Bug

When I try to upgrade my installation to the lates version I got this error:

$ php82 artisan migrate

                                                           APPLICATION IN PRODUCTION.

Are you sure you want to run this command? (yes/no) [no]
> yes

   INFO  Running migrations.

  2020_09_27_210059_add_entity_soft_deletes ..................................................................................... 118.15ms DONE
  2020_09_27_210528_create_deletions_table ........................................................................................ 9.27ms DONE
  2020_11_07_232321_simplify_activities_table ..................................................................................... 1.01ms FAIL

In Connection.php line 825:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'generation_expression' in 'field list' (Connection: mysql, SQL: select column_name a
  s `name`, data_type as `type_name`, column_type as `type`, collation_name as `collation`, is_nullable as `nullable`, column_default as `defa
  ult`, column_comment as `comment`, generation_expression as `expression`, extra as `extra` from information_schema.columns where table_schem
  a = 'mydb_bstack' and table_name = 'activities' order by ordinal_position asc)


In Connection.php line 407:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'generation_expression' in 'field list'

It looks like a problem with table: activities. How to go ahead with this upgrade?

Steps to Reproduce

Previous working version: v0.30.4
Get the newest version to new directory.
Run php artisam migrate

Expected Behaviour

Migration finish with success.

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

BookStack v25.07.1

Originally created by @mariaczi on GitHub (Aug 25, 2025). ### Describe the Bug When I try to upgrade my installation to the lates version I got this error: ``` $ php82 artisan migrate APPLICATION IN PRODUCTION. Are you sure you want to run this command? (yes/no) [no] > yes INFO Running migrations. 2020_09_27_210059_add_entity_soft_deletes ..................................................................................... 118.15ms DONE 2020_09_27_210528_create_deletions_table ........................................................................................ 9.27ms DONE 2020_11_07_232321_simplify_activities_table ..................................................................................... 1.01ms FAIL In Connection.php line 825: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'generation_expression' in 'field list' (Connection: mysql, SQL: select column_name a s `name`, data_type as `type_name`, column_type as `type`, collation_name as `collation`, is_nullable as `nullable`, column_default as `defa ult`, column_comment as `comment`, generation_expression as `expression`, extra as `extra` from information_schema.columns where table_schem a = 'mydb_bstack' and table_name = 'activities' order by ordinal_position asc) In Connection.php line 407: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'generation_expression' in 'field list' ``` It looks like a problem with table: activities. How to go ahead with this upgrade? ### Steps to Reproduce Previous working version: v0.30.4 Get the newest version to new directory. Run `php artisam migrate` ### Expected Behaviour Migration finish with success. ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version BookStack v25.07.1
OVERLORD added the 🐛 Bug label 2026-02-05 10:02:46 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Aug 26, 2025):

Hi @mariaczi,
That's quite a large upgrade! Should be find from BookStack's point of view though, as long as you meet the requirements for the latter version.

Ensure you have safe backups of the data and database before doing anything further.

Can you confirm the exact version of the database in use?
With such an old instance, I'm wondering if an old database version is used here which does not support some features.

@ssddanbrown commented on GitHub (Aug 26, 2025): Hi @mariaczi, That's quite a large upgrade! Should be find from BookStack's point of view though, as long as you meet the requirements for the latter version. Ensure you have safe backups of the data and database before doing anything further. Can you confirm the exact version of the database in use? With such an old instance, I'm wondering if an old database version is used here which does not support some features.
Author
Owner

@mariaczi commented on GitHub (Aug 26, 2025):

Yes, I know it is a large upgrade, but I didn't catch a time to do it earlier :/
When I am in the directory with the previous version v0.30.4 and execute
php artisan migrate
i got:

$ php72 artisan migrate
**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes

Nothing to migrate.

$ php72 -v
PHP 7.2.34 (cli) (built: May 16 2024 13:37:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with the ionCube PHP Loader + ionCube24 v13.0.4, Copyright (c) 2002-2024, by ionCube Ltd.

For the newest version I use php v8.2; php82 is an ailas on the server:

$ LC_ALL=en_US.utf8 && type php82
php82 is aliased to `/opt/alt/php82/usr/bin/php'

All required dependencies in "vendor" I have installed for the newest version.

Yes, I have a backup of files and database before strating upgrade process :) and in the DB dump the activities table looks:

DROP TABLE IF EXISTS `activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activities` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `extra` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `book_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `entity_id` int(11) NOT NULL,
  `entity_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `activities_book_id_index` (`book_id`),
  KEY `activities_user_id_index` (`user_id`),
  KEY `activities_entity_id_index` (`entity_id`),
  KEY `activities_key_index` (`key`),
  KEY `activities_created_at_index` (`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=469 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@mariaczi commented on GitHub (Aug 26, 2025): Yes, I know it is a large upgrade, but I didn't catch a time to do it earlier :/ When I am in the directory with the previous version v0.30.4 and execute `php artisan migrate` i got: ``` $ php72 artisan migrate ************************************** * Application In Production! * ************************************** Do you really wish to run this command? (yes/no) [no]: > yes Nothing to migrate. $ php72 -v PHP 7.2.34 (cli) (built: May 16 2024 13:37:36) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with the ionCube PHP Loader + ionCube24 v13.0.4, Copyright (c) 2002-2024, by ionCube Ltd. ``` For the newest version I use php v8.2; php82 is an ailas on the server: ``` $ LC_ALL=en_US.utf8 && type php82 php82 is aliased to `/opt/alt/php82/usr/bin/php' ``` All required dependencies in "vendor" I have installed for the newest version. Yes, I have a backup of files and database before strating upgrade process :) and in the DB dump the `activities` table looks: ``` DROP TABLE IF EXISTS `activities`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `activities` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `extra` text COLLATE utf8mb4_unicode_ci NOT NULL, `book_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `entity_id` int(11) NOT NULL, `entity_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `activities_book_id_index` (`book_id`), KEY `activities_user_id_index` (`user_id`), KEY `activities_entity_id_index` (`entity_id`), KEY `activities_key_index` (`key`), KEY `activities_created_at_index` (`created_at`) ) ENGINE=InnoDB AUTO_INCREMENT=469 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; ```
Author
Owner

@ssddanbrown commented on GitHub (Aug 27, 2025):

Can you confirm the exact version of the database in use?
That's really the key thing that may be resulting in the error message shared.

@ssddanbrown commented on GitHub (Aug 27, 2025): Can you confirm the exact version of the database in use? That's really the key thing that may be resulting in the error message shared.
Author
Owner

@mariaczi commented on GitHub (Aug 27, 2025):

Yes, sure, I can. How I can check it? Or, do you have in mind the MySQL Server version? MySQL Server version on the server is:
-- Server version 10.1.48-MariaDB-cll-lve

@mariaczi commented on GitHub (Aug 27, 2025): Yes, sure, I can. How I can check it? Or, do you have in mind the MySQL Server version? MySQL Server version on the server is: `-- Server version 10.1.48-MariaDB-cll-lve`
Author
Owner

@ssddanbrown commented on GitHub (Aug 27, 2025):

Hi @mariaczi,

So yeah, that's quite an old MariaDB version, and likely the cause of the reported error message.
Ideally you'd migrate to a current supported version (looks like 10.6 at a minimum) if possible, before attempting the upgrade.

@ssddanbrown commented on GitHub (Aug 27, 2025): Hi @mariaczi, So yeah, that's quite an old MariaDB version, and likely the cause of the reported error message. Ideally you'd migrate to a current supported version (looks like 10.6 at a minimum) if possible, before attempting the upgrade.
Author
Owner

@mariaczi commented on GitHub (Aug 27, 2025):

OK, thank you very much for your information. I try to ask my hosting provider about the newer version of MariaDB.
Please, give me a few time for they answer ;)

@mariaczi commented on GitHub (Aug 27, 2025): OK, thank you very much for your information. I try to ask my hosting provider about the newer version of MariaDB. Please, give me a few time for they answer ;)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5411