Failed Upgrade Tips Mifos X

These tips are written for Mifos X users facing errors during upgrade due to schema version failure.

On this page:

To learn how to upgrade an existing installation of Mifos X, follow this guide: https://github.com/openMF/mifosx/wiki/Installation-FAQ's#upgrading-an-existing-installation-of-mifosx

It is highly recommended to backup your existing databases before upgrading Mifos X. 

For some users, during upgradation of Mifos X, an error (Migration of schema failed!) might occur, as shown in the screenshot below:


You should follow the following steps to fix the issue:- 

Step 1: 

Stop the Tomcat server. 

Step 2: 

For this example, we shall be considering the following error:

Migration of schema `mifostenant-default` to version 251 failed! 

This error occurs when upgrading to Mifos X 15.03.1v. Go to the downloaded Mifos X folder: 

Step 3:

Go to path: mifosplatform-15.03.1.RELEASE\database\migrations\core_db.

Locate the failed version, i.e., V251 in this example.

Step 4: 

Open the SQL script in any text editor (Notepad++, Sublime Text, etc.):

Step 5:

Copy the following SQL scripts one-by-one till the semi-colon (;), as shown in the screenshot below: 


Step 6: 

To make things simpler, this example requires HeidiSQL. (http://www.heidisql.com/download.php

Follow the instructions below (the image displays numbers corresponding to the instruction number):

1) Go to the failed database (in this example, it is `mifostenant-default`) and click on it.

2) Click on the query tab

3) Paste the copied script (1) (from Step 5 above)

4) Click on >(play) button to run the script. 

If the table already exists, it will give an error message, otherwise it will create the table. Irrespective of whether the table already exists or not, you need run all the scripts one by one as mentioned in Step 5 & 6 until all the SQL scripts (copied from Step 5) are executed.

Step 7: 

Follow the numbers mentioned in image below and the corresponding instructions:

1) Go to the table schema_version.

2) Click on Data.

3) Scroll to version 251 (for this example) and make sure the table name is the same (like the paymentType_table shown below).

4) Scroll to the right side of the page. 

5) The value of the success column will vary between 0 (for failure) and 1 (for success). Change this value to 1 and click on the other table to make it run.

8) Make sure that the success column value has become 1(one). 

Step 8:

Restart the tomcat server.

  • If the fix is successful, you can now start using Mifos X.
  • However, if following all the steps doesn't fix the issue, then repeat all the steps above.


Similarly, if the migration of schema 'mifosplatform-tenants' to version 2 failed: 



Step 1:

Go to this path: mifosplatform-15.03.1.RELEASE\database\migrations\list_db

Locate the failed version (in this example, V2):



Step 2:

Copy the script till the semi-colon (;), as shown in the screenshot below: 

Step 3:

For ease of operations, this example makes use of HeidiSQL (http://www.heidisql.com/download.php).

Follow these instructions (for more information, refer to the image below):

1) Go to the failed database (in this example, it is `mifosplatform-tenants`) and click on it.

2) Click on the query tab

3) Paste the copied script (1) from the above shown example

4) Click on >(play) button to run the script.

Step 4:

Scroll to the right side of the page 

The value of the success column will vary between 0 (for failure) and 1 (for success). Change this value to 1 and click on the other table to make it run.

Make sure the value in the success column has become 1 (one). 

Step 5:

Restart the tomcat server.

  • If the fix is successful, you can now start using Mifos X.
  • However, if following all the steps doesn't fix the issue, then repeat all the steps above.


Related articles