In some cases - typically if the SQL file exported is too large - importing the SQL file to MySQL will raise the following error and fail to import:
ERROR 2013 (HY000) at line 915: Lost connection to MySQL server during query
The line number may change of course, but the rest of the error should be as above. Instructions being followed for the expedited upgrade where this issue may have been encountered is documented here.
This article applies to all supported versions of API Gateway, including Gateway 10.
There can be multiple causes, but the most common one is that the exported SQL file is too large and MySQL takes too long to process the import that it times out and loses the connection.
The simplest solution is below, with an alternative solution below that.
Simple solution:
If the above solution is not possible in the environment as you cannot afford to lose the audits from an existing Gateway for example, then the more complicated (and discouraged) approach is below if needed:
A reminder that audits should ideally not be enabled especially in production environments due to performance impacts and issues that'd be avoided if the audits were external to a syslog server somewhere else. If that was being done, then - indirectly - this issue should not ever be encountered.