Upgrading Code Insight
The following commands are for Linux. Windows users may choose to perform the steps with a mouse.
| 1. | Shut down Code Insight. For multi-server installs, shut down all servers. |
cd $OLD_DIR/tomcat/bin
./shutdown.sh
| 2. | Back up the database. This step applies to the Core Server only. |
These commands are for MySQL. If you are using Oracle or SQL Server, obtain a fresh backup from your DBA before proceeding. Make sure your DBA is available to restore the backup promptly in case it is needed.
mkdir -p $BACK_DIR/$OLD_VER
cd $BACK_DIR/6.14.2
mysqldump -h $DB_HOST -u $DB_USER --password=$DB_PASS -r migration_db.sql $DB_NAME
| 3. | Backup the workspaces directory. This step applies to all Scan Servers. |
Note:This backup may take a long time depending on the size of your workspaces directory.
cd $WS_DIR
tar cf $BACK_DIR/$OLD_VER/migration_ws.tar .
| 4. | Backup the application directory. |
cd $OLD_DIR
# clear the tomcat temp files
rm -r tomcat/temp/*
tar czf $BACK_DIR/$OLD_VER/migration_app.tgz .
| 5. | Extract the 6.14.2 distribution zip file (CodeInsight-6.14.2.zip) and move it to the new directory. |
unzip -q CodeInsight-6.14.2.zip -d /tmp
mv /tmp/CodeInsight_6.14.2 $NEW_DIR
| 6. | Run the migrationImport.groovy script. |
cd $NEW_DIR/scriptRunner/bin
./scriptRunner.sh ‐n ../scripts/migrationImport.groovy $OLD_DIR
| 7. | Check the TODO log for any additional steps needed. Complete any necessary steps before continuing. |
cat $NEW_DIR/scriptRunner/log/migration.TODO.log
| 8. | Run the database schema migration. This step applies to the Core Server only. |
cd $NEW_DIR/scriptRunner/bin
./migrate.sh $OLD_VER
If database errors are encountered, rerun the database schema migration after resolving the error.
| 9. | Run the new reports.sql to install new reports. Use the appropriate file according to your database vendor (MySQL in this example). This step applies to the Core Server only. |
Note:The reports.sql file will overwrite any modifications to the report tables in the database. If you have custom reports, you will need to re-run the custom SQL to install them after you have run the new reports.sql file. Make sure you have your custom SQL scripts before you run this.
mysql ‐h $DB_HOST ‐u "$DB_USER" ‐‐password="$DB_PASS" ‐D $DB_NAME \
‐e "source $NEW_DIR/dbScripts/mysql/reports.sql"
Note:Code Insight 6.14.2 has features that require a Data Services Enabled key. You can continue to use the application with your existing key, but there will be errors seen with the features that require this key.
| 10. | Start the new Code Insight application. For multi-server installs, do this after you have completed the previous steps on all servers. |
cd $NEW_DIR/tomcat/bin
./startup.sh && tail ‐f ../logs/catalina.out
| 11. | Check the log for any errors, and resolve them before continuing. |
| 12. | (Optional) Run the migrateFromAnalyzerToCodeAware.groovy script to update workspaces that were previously configured for the Analyzer to now use CodeAware. (The script automatically selects CodeAware on the Automated Analysis tab for each of these workspaces; it ignores workspaces already configured for CodeAware.) The script will prompt you for the scope on which it should run—on all projects, on a specific project, or on a specific workspace. |
Note the following:
| • | Before running the script, ensure that the property disableAnalyzer, located in the scanEngine.properties file, is set to true. |
| • | The script is needed for only those project workspaces that you intend to rescan, so select a scope that makes the most sense. |
| • | If you do not run this script, CodeAware is not automatically selected on the Automated Analysis tab for workspaces previously configured to use the Analyzer. For each workspace that you intend to rescan using CodeAware, you will need to manually select the CodeAware option. |
| 13. | Log into the Web UI and run the Electronic Update. This step applies to the Core Server only. |
Note:Do not skip this step.
In most cases, the Electronic Update will be scheduled automatically. Check the Scheduler tab in the Web UI. If the update is not running, trigger it through Administration > Updates, and click Check for Electronic Update.
If your application does not have outgoing Internet access on port 22, you will need to run the update manually.
Note:If you run into any issues with detection of Cocoapod packages, re-run the Electronic Update.