Skip to content

Commit

Permalink
[release-v1.5.1][doc]: Upgrade instructions fixed. SOLR schema needed…
Browse files Browse the repository at this point in the history
… upgrading before db upgrade would work. How to deal with duplicate user names error (a bit dense, but useful nonetheless). Typo in search-index rebuild.
  • Loading branch information
David Read committed Jan 4, 2012
1 parent 4a8ad10 commit 0f86c8a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
8 changes: 7 additions & 1 deletion doc/common-error-messages.rst
Expand Up @@ -129,4 +129,10 @@ This sort of message may be seen if you swap between different branches of CKAN.
``AssertionError: Unexpected files/directories in pyenv/src/ckan``
==================================================================

This occurs when installing CKAN source to a virtual environment when using an old version of pip. (e.g. pip 0.3.1 which comes with Ubuntu). Instead you should use pip 1.0.2 or higher, which will be found in your virtual environment: ``pyenv/bin/pip``
This occurs when installing CKAN source to a virtual environment when using an old version of pip. (e.g. pip 0.3.1 which comes with Ubuntu). Instead you should use pip 1.0.2 or higher, which will be found in your virtual environment: ``pyenv/bin/pip``

``sqlalchemy.exc.IntegrityError: (IntegrityError) could not create unique index "user_name_key``
================================================================================================

This occurs when upgrading to CKAN 1.5.1 with a database with duplicate user names. See :ref:`upgrading`

40 changes: 24 additions & 16 deletions doc/install-from-package.rst
Expand Up @@ -687,20 +687,6 @@ Install the new CKAN and update all the dependencies:

Now you need to make some manual changes. In the following commands replace ``std`` with the name of your CKAN instance. Perform these steps for each instance you wish to upgrade.

#. Upgrade the database

First install pastescript:

::
sudo -u ckanstd /var/lib/ckan/std/pyenv/bin/pip install --ignore-installed pastescript

Then upgrade the database:

::

sudo -u ckanstd /var/lib/ckan/std/pyenv/bin/paster --plugin=ckan db upgrade --config=/etc/ckan/std/std.ini

#. Upgrade the Solr schema

Configure ``ckan.site_url`` or ``ckan.site_id`` in ``/etc/ckan/std/std.ini`` for SOLR search-index rebuild to work. eg:
Expand All @@ -718,11 +704,33 @@ Now you need to make some manual changes. In the following commands replace ``st
sudo rm /usr/share/solr/conf/schema.xml
sudo ln -s /usr/lib/pymodules/python2.6/ckan/config/solr/schema-1.3.xml /usr/share/solr/conf/schema.xml

Rebuild the search index (this can take some time):
#. Upgrade the database

First install pastescript:

::
sudo -u ckanstd /var/lib/ckan/std/pyenv/bin/pip install --ignore-installed pastescript

Then upgrade the database:

::

sudo -u ckanstd /var/lib/ckan/std/pyenv/bin/paster --plugin=ckan db upgrade --config=/etc/ckan/std/std.ini

If you get error ``sqlalchemy.exc.IntegrityError: (IntegrityError) could not create unique index "user_name_key`` then you need to rename users with duplicate names before it will work. For example::

sudo -u ckanstd paster --plugin=pylons shell /etc/ckan/std/std.ini
model.meta.engine.execute('SELECT name, count(name) AS NumOccurrences FROM "user" GROUP BY name HAVING(COUNT(name)>0);').fetchall()
users = model.Session.query(model.User).filter_by(name='https://www.google.com/accounts/o8/id?id=ABCDEF').all()
users[1].name = users[1].name[:-1]
model.repo.commit_and_remove()

#. Rebuild the search index (this can take some time):

::

sudo -u ckanstd /var/lib/ckan/std/pyenv/bin/paster --plugin=ckan search index rebuild --config=/etc/ckan/std/std.ini
sudo -u ckanstd /var/lib/ckan/std/pyenv/bin/paster --plugin=ckan search-index rebuild --config=/etc/ckan/std/std.ini

#. Restart Apache

Expand Down

0 comments on commit 0f86c8a

Please sign in to comment.