Hello! I created a quick guide to fix websites after a migration. Depending on the application type, the steps will differ.
A regular Django / Apache app created from the control panel. Generally the only thing
required is to reinstall the database driver (for either MySQL or Postgres) in the
virtualenv. The virtualenv is a folder in the application directory, usually named
*ENV
. Just activate it and reinstall the DB driver from pip. Then restart from with
apache2/bin/restart
.
We also use custom Django + memcache + gunicorn apps, and supervisor
to manage gunicorn
processes. If the application is of type "Custom":
-
Locate and activate the virtualenv. It will be in
~/.virtualenvs
and be named after the website record. -
Reinstall the DB adapter from pip (most likely using Postgres in these apps).
-
If supervisor is not running: Run from the home directory:
~/bin/supervisord -c ~/etc/supervisord.conf
You can install
supervisord
from the account-wide pip if it's not found. Only needs to be executed once per server. -
If memcache is not running: Run:
memcached -d -m 50 -s ~/memcached.sock -P ~/memcached.pid
Only needs to be executed once per server.
-
Once supervisor is running and the virtualenv fixed, you can restart the site by running from home:
supervisorctl restart gunicorn_<app name>
Where
<app name>
is the name of the website record. If you receive no errors the site's back up! Otherwise you can check the logs at~/logs/user/<app name>_error.log
. -
To see which sites are running:
supervisorctl status