Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Look in the footer for "Installed Version" to confirm that the patch was applied, and the new version is recognized.

That's it!

Failed Upgrade / Errors After Upgrade

If running /admin/upgrade does not complete all the database migrations, things may not work correctly and it may be necessary to modify a migration task so that it picks back up where it failed. The first step is to determine what the last completed migration version was. To find out, run this query:

Code Block
languagesql
SELECT `value` FROM `settings` WHERE `key`='database_version';

As an example, let's say this returns: 4.4.0-b1 but you uploaded the files for 4.6.0. Please note that there is not a direct correlation between the database version and the version of Blesta you are running. If your database says 4.4.0-b1 you could be running 4.4.2 if there were no database changes between 4.4.0-b1 and 4.4.2.

Next, look at the migration tasks in /components/upgrades/tasks/, you'll see files like this:

...
upgrade4_3_0_b1.php
upgrade4_4_0_b1.php
upgrade4_5_0_b1.php
upgrade4_6_0_b1.php
upgrade4_6_0.php
upgrade4_7_0_b1.php
...

The version in the filename corresponds to the version in your database. If your database shows 4.4.0-b1, then the last migration task it fully completed was upgrade4_4_0_b1.php. This means that when it tried to run the next migration, upgrade4_5_0_b1.php one of the tasks in that file failed. Errors that you are getting in your logs may help identify which task failed, but lets look at upgrade4_5_0_b1.php because we know something in that file failed. Edit the file in your favorite text editor, that will not modify the file encoding (UTF-8) or line endings. Look for the function tasks() and the methods listed within.

Code Block
languagephp
    public function tasks()
    {
        return [
            'addProxySetting',
            'updateInvoiceTerms',
            'addPackageNames',
            'addPackageDescriptions',
            'addPackageGroupNames',
            'addPackageGroupDescriptions',
        ];
    }

In the example above, we can see that the following tasks are run in order to upgrade to 4.5.0-b1:

  • addProxySetting
  • updateInvoiceTerms
  • addPackageNames
  • addPackageDescriptions
  • addPackageGroupNames
  • addPackageGroupDescriptions

If addProxySetting has already ran, then we can comment it out and run /admin/upgrade again in our browser. Then, check your database version again. If it's not at least 4.5.0-b1, then we may need to comment out the next task, updateInvoiceTerms and run /admin/upgrade again and check the database version again. Continue commenting out tasks ONE at a time and running /admin/upgrade until the upgrade is able to complete and shows the version of the most recent file in /components/upgrades/tasks/

Here's an example of a commented out task:

Code Block
languagephp
    public function tasks()
    {
        return [
            //'addProxySetting',
            'updateInvoiceTerms',
            'addPackageNames',
            'addPackageDescriptions',
            'addPackageGroupNames',
            'addPackageGroupDescriptions',
        ];
    }