From 5c5f3a5ea6513299c434934eb12d31efd30637ce Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Wed, 18 Mar 2015 14:17:49 +0000 Subject: [PATCH] Wrap askbot migration steps in code blocks Wrap the migration commands for askbot in shell code blocks so that the HTML formatting is more amenable to cutting and pasting. Change-Id: I86e3c518daa875551d8a671d7775ad932391f420 --- specs/migrate_askbot.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/specs/migrate_askbot.rst b/specs/migrate_askbot.rst index dd35ff3..174d6ec 100644 --- a/specs/migrate_askbot.rst +++ b/specs/migrate_askbot.rst @@ -129,12 +129,16 @@ Invoke management commands The management cli tool is available under /srv/askbot-sites/slot0/config, so to invoke management commands you need to enter this directory first. +.. code-block:: bash + $ cd /srv/askbot-sites/slot0/config $ python manage.py Stop celeryd and apache, jetty services --------------------------------------- +.. code-block:: bash + $ sudo service askbot-celeryd stop $ sudo service apache2 stop $ sudo service jetty stop @@ -144,17 +148,23 @@ Restore database dump Recreate an empty database: +.. code-block:: bash + $ sudo su - postgres -c 'dropdb askbotdb' $ sudo su - postgres -c 'createdb askbotdb --owner=ask' Restore from backup: +.. code-block:: bash + $ psql -d askbotdb -h localhost -U ask -W -f /path/to/last-dump.sql `Notice` you will be prompted for the ask_db_password from hiera. Sync db and migrate: +.. code-block:: bash + $ cd /srv/askbot-sites/slot0/config $ sudo python manage.py syncdb $ sudo python manage.py migrate @@ -164,12 +174,16 @@ Sync db and migrate: Start celeryd ------------- +.. code-block:: bash + $ sudo service askbot-celeryd start $ sudo service apache2 start Rebuild solr indexes -------------------- +.. code-block:: bash + $ sudo service jetty start $ cd /srv/askbot-sites/slot0/config $ sudo python manage.py askbot_rebuild_index -l en @@ -177,6 +191,8 @@ Rebuild solr indexes Test the solr deployment, query string "sahara": +.. code-block:: bash + $ curl "http://127.0.0.1:8983/solr/core-en/select/?fq=django_ct%3A%28askbot.thread%29&rows=10&q=%28sahara%29&start=0&wt=json&fl=%2A+score" `Notice` this query must return a non-empty resultset. @@ -184,6 +200,8 @@ Test the solr deployment, query string "sahara": Restart celeryd --------------- +.. code-block:: bash + $ sudo service askbot-celeryd restart $ sudo service apache2 restart @@ -194,6 +212,8 @@ Static files must be extracted into /srv/askbot-sites/slot0/upfiles directory. It mostly holds profile pictures, and site logo, so if pictures not showing up in the site those files are missing, or have a wrong file permission. +.. code-block:: bash + $ cd /srv/askbot-sites/slot0 $ sudo rm -rf upfiles $ sudo tar xf /path/to/last-upfiles.tar --strip-components=2