Upgrade steps from older version 5.2

I have inherited a Matomo 5.2 install and I am wondering what is the best process to upgrade to 5.11.1? I tried jumping straight and I’m getting the error below. Do I need to do some kind of stepped upgrade?

Data is currently unavailable. This could be due to a temporary server issue or the report containing too much data. Please try again later. If the problem continues, please contact your Matomo administrator for assistance.

Is there a way to run the database migrations from CLI? After running through the upgrade for the fourth time, it appears the migrations are getting stopped either by an nginx, php, or some other timeout.