When you perform an upgrade from 9.3, 9.3.1 and 9.4 you may be presented with errors as follows:
CloudBolt upgrader [20200512.0859]: 10-cloudbolt=>upgrading=> Failed to perform database migration!
CloudBolt upgrader [20200512.0859]: CloudBolt upgrader failed on <IPADDRESS> while upgrading component 10-cloudbolt!
In the /var/log/cloudbolt/install/upgrade_NNNNNN.NNNN.log or the /var/log/cloudbolt/ssl_error_log.log you may see something similar to:
MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'portals_portalconfig.sso_provider_id' in 'field list'")
When you are upgrading from 9.3 and above, you need to update the database schema. You may have to run the migration process manually and run the upgrade again, or “fake” a migration for the process to work.
Below are some steps to follow depending on the specific error message you receive. First off you will need to ensure you have run the database migration. If you still see very specific error messages around for example:
Then you will have to run the migration for the failing component.
Ensure you have completed the Database migration steps of the upgrade process
Follow the Run Django Database Migrations step in the Upgrading to 9.X documentation
You may have to follow the manual migrate if an upgrade fails and then try the upgrade again.
If your export included a database dump and load, you will need to run database migrations. This is because the database on your new CloudBolt 9.X instance will be in the exact same state as the database on your CloudBolt 8.X instance, but the CloudBolt 9.X instance will have code and schema changes that the CloudBolt 8.X instance lacks.
Fortunately, running Django database migrations is straightforward.
Log in to your CloudBolt 9.X machine.
Run the Django migration management command
python /opt/cloudbolt/manage.py migrate./opt/cloudbolt/ is the default directory for CloudBolt, but your root CloudBolt directory could be somewhere else.
Wait for the migrations to complete, then restart httpd
systemctl restart httpd.
If you have already done the above and you received an error message specific to a section. Then keep following on.
Running the migration for a failing component
If you have run the migration and have come across a specific component failure. Then you can run the migration for just that component.
SSH into your CloudBolt server if you have not already and run the following command
/opt/cloudbolt/manage.py --fake <app_name> 0007_new_migration
Replace <app_name> with the error message, for this example it is Portals
/opt/cloudbolt/manage.py --fake portals 0007_new_migration
Once this migration completes, re run the complete migration.
If step 4 still has a failure, repeat step 3 for the noted failing component then step 4 again. Continue to repeat until step 4 runs without any failures.
Upgrading to CloudBolt 9.x : https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/upgrading-to-9-x/a/h2__1646278176