.. index:: upgrading; from 3.0.x

Upgrading from 3.0.x to 3.1.x
=============================

#. Upgrade packages. Run the following commands:

   .. code-block:: bash

        apt-get update
        apt-get install karaage3

   If asked if you want to run to run migrations, so No. This will happen
   later.

#. Merge in changes from ``/etc/karaage/global_settings.py`` into
   ``/etc/karaage3/settings.py``. Or just copy the file should be sufficient.

#. If required, install Karaage plugins. See :doc:`/plugins` for more
   information.

#. Otherwise purge karaage3-celery if kgusage not required.

#. Any old Apache configuration might conflict with the new Apache
   configuration.  Apache 2.2 in Wheezy uses
   ``/etc/apache2/conf.d/karaage3-wsgi.conf``. Any other configuration files may
   be obsolete and should be deleted (or moved elsewehere).

#. Run the database migrations and restart apache.

   If you have upgraded Django to 1.7 you will need to run south migrations
   first. Running this command is perfectly safe from Django 1.6, however not
   required. This must be run before running Django 1.7 migrations however.

   .. code-block:: bash

        apt-get install virtualenv         # Debian Jessie only
        apt-get install python-virtualenv  # Debian Wheezy only
        kg-migrate-south --noinput

   Regardless of what version of Django you have installed, continue and
   run the native migrations.

   .. code-block:: bash

        kg-manage migrate
        service apache2 reload

#.  Remove old package that might cause problems.

    .. code-block:: bash

        dpkg --purge python-karaage-celery

#.  Old packages and files can be removed. This is optional.

    .. code-block:: bash

        dpkg --purge karaage3-admin
        dpkg --purge karaage3-registration
        dpkg --purge python-karaage-doc
        rm -rf /etc/karaage
        rm -rf /var/log/karaage
        rm -rf /var/log/karaage3-celery
        rm -rf /var/cache/karaage


Other changes
-------------

*   Check that remote services that access Karaage work. For example, with
    torque_submitfilter, you need to update the Karaage URL to ``/karaage/``.

#.  If using MAM, edit the :setting:`MACHINE_CATEGORY_DATASTORES` setting in
    ``/etc/karaage3/settings.py``:

    .. code-block:: python

           {
               'DESCRIPTION': 'MAM datastore',
               'ENGINE': 'karaage.datastores.mam.MamDataStore',
               ...
           }
