Project

General

Profile

Actions

How to migrate old databases ie previous to redmine 4.2.0

Feature #1237 in redmine version 4.2.0 provided support for two factor authentication.
WRT the database this means that there is a new row in the "settings" table. Without it, you will see the following error after a normal migration from a database older than 4.2.0:

redmine  | I, [2022-08-22T12:17:53.213673 #1]  INFO -- : Started GET "/" for 999.999.99.999 at 2022-08-22 12:17:53 +0000
redmine  | I, [2022-08-22T12:17:53.214458 #1]  INFO -- : Processing by WelcomeController#index as HTML
redmine  | I, [2022-08-22T12:17:53.216785 #1]  INFO -- : Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.7ms | Allocations: 1346)
redmine  | F, [2022-08-22T12:17:53.217337 #1] FATAL -- :
redmine  | ActiveRecord::StatementInvalid (Mysql2::Error: Table 'redmine.settings' doesn't exist):

The following is an example to insert that row in MariaDB:

LOCK TABLES `settings` WRITE;
/*!40000 ALTER TABLE `settings` DISABLE KEYS */;
INSERT INTO `settings` VALUES (69,'twofa','0','2022-10-05 12:59:05');
/*!40000 ALTER TABLE `settings` ENABLE KEYS */;
UNLOCK TABLES;

Firts value (69) and last one (current date) might change in your case.

Updated by Pedro Gutierrez over 1 year ago · 2 revisions