Changeset - 874ed3e58579
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 7 years ago 2018-12-28 22:11:40
thomas.de_schampheleire@nokia.com
docs: upgrade: misc. clarification on upgrade from 0.3.x to 0.4
1 file changed with 9 insertions and 2 deletions:
0 comments (0 inline, 0 general)
docs/upgrade.rst
Show inline comments
 
@@ -34,95 +34,97 @@ You are of course strongly recommended t
 
is *especially* important to make a full database and configuration
 
backup before performing a Kallithea upgrade.
 

	
 
Back up your configuration
 
^^^^^^^^^^^^^^^^^^^^^^^^^^
 

	
 
Make a copy of your Kallithea configuration (``.ini``) file.
 

	
 
If you are using :ref:`rcextensions <customization>`, you should also
 
make a copy of the entire ``rcextensions`` directory.
 

	
 
Back up your database
 
^^^^^^^^^^^^^^^^^^^^^
 

	
 
If using SQLite, simply make a copy of the Kallithea database (``.db``)
 
file.
 

	
 
If using PostgreSQL, please consult the documentation for the ``pg_dump``
 
utility.
 

	
 
If using MySQL, please consult the documentation for the ``mysqldump``
 
utility.
 

	
 
Look for ``sqlalchemy.url`` in your configuration file to determine
 
database type, settings, location, etc.
 
database type, settings, location, etc. If you were running Kallithea 0.3.x or
 
older, this was ``sqlalchemy.db1.url``.
 

	
 

	
 
3. Activate the Kallithea virtual environment (if any)
 
------------------------------------------------------
 

	
 
Verify that you are using the Python environment that you originally
 
installed Kallithea in by running::
 

	
 
    pip freeze
 

	
 
This will list all packages installed in the current environment. If
 
Kallithea isn't listed, activate the correct virtual environment.
 
See the appropriate installation page for details.
 

	
 

	
 
4. Install new version of Kallithea
 
-----------------------------------
 

	
 
Please refer to the instructions for the installation method you
 
originally used to install Kallithea.
 

	
 
If you originally installed using pip, it is as simple as::
 

	
 
    pip install --upgrade kallithea
 

	
 
If you originally installed from version control, assuming you did not make
 
private changes (in which case you should adapt the instructions accordingly)::
 

	
 
    cd my-kallithea-clone
 
    hg parent   # make a note of the original revision
 
    hg pull
 
    hg update
 
    hg parent   # make a note of the new revision
 
    pip install --upgrade -e .
 

	
 
.. _upgrade_config:
 

	
 

	
 
5. Upgrade your configuration
 
-----------------------------
 

	
 
Run the following command to create a new configuration (``.ini``) file::
 

	
 
    kallithea-cli config-create new.ini
 

	
 
Then compare it with your old config file and see what changed.
 
Then compare it with your old config file and copy over the required
 
configuration values from the old to the new file.
 

	
 
.. note::
 
    Please always make sure your ``.ini`` files are up to date. Errors
 
    can often be caused by missing parameters added in new versions.
 

	
 
.. _upgrade_db:
 

	
 

	
 
6. Upgrade your database
 
------------------------
 

	
 
.. note::
 
    If you are *downgrading* Kallithea, you should perform the database
 
    migration step *before* installing the older version. (That is,
 
    always perform migrations using the most recent of the two versions
 
    you're migrating between.)
 

	
 
First, run the following command to see your current database version::
 

	
 
    alembic -c new.ini current
 

	
 
Typical output will be something like "9358dc3d6828 (head)", which is
 
the current Alembic database "revision ID". Write down the entire output
 
for troubleshooting purposes.
 
@@ -176,48 +178,53 @@ Your config file should now work with Al
 

	
 
7. Prepare the front-end
 
------------------------
 

	
 
Starting with Kallithea 0.4, external front-end dependencies are no longer
 
shipped but need to be downloaded and/or generated at installation time. Run the
 
following command::
 

	
 
    kallithea-cli front-end-build
 

	
 

	
 
8. Rebuild the Whoosh full-text index
 
-------------------------------------
 

	
 
It is recommended that you rebuild the Whoosh index after upgrading since
 
new Whoosh versions can introduce incompatible index changes.
 

	
 

	
 
9. Start the Kallithea web application
 
--------------------------------------
 

	
 
This step once again depends entirely on the web server software used to
 
serve Kallithea.
 

	
 
If you were running Kallithea 0.3.x or older and were using ``paster serve
 
my.ini`` before, then the corresponding command in Kallithea 0.4 and later is::
 

	
 
    gearbox serve -c new.ini
 

	
 
Before starting the new version of Kallithea, you may find it helpful to
 
clear out your log file so that new errors are readily apparent.
 

	
 
.. note::
 
    If you're using Celery, make sure you restart all instances of it after
 
    upgrade.
 

	
 

	
 
10. Update Git repository hooks
 
-------------------------------
 

	
 
It is possible that an upgrade involves changes to the Git hooks installed by
 
Kallithea. As these hooks are created inside the repositories on the server
 
filesystem, they are not updated automatically when upgrading Kallithea itself.
 

	
 
To update the hooks of your Git repositories:
 

	
 
* Go to *Admin > Settings > Remap and Rescan*
 
* Select the checkbox *Install Git hooks*
 
* Click the button *Rescan repositories*
 

	
 
.. note::
 
    Kallithea does not use hooks on Mercurial repositories. This step is thus
 
    not necessary if you only have Mercurial repositories.
0 comments (0 inline, 0 general)