##// END OF EJS Templates
db: drop RhodeCode compatibility (database rebranding etc.)...
Søren Løvborg -
r5976:0b6d2ca7 default
parent child Browse files
Show More
@@ -162,76 +162,14 b' You can also build the documentation loc'
162 install it via the command: ``pip install sphinx`` .
162 install it via the command: ``pip install sphinx`` .
163
163
164
164
165 Converting from RhodeCode
165 Migrating from RhodeCode
166 -------------------------
166 ------------------------
167
168 Currently, you have two options for working with an existing RhodeCode
169 database:
170
171 - keep the database unconverted (intended for testing and evaluation)
172 - convert the database in a one-time step
173
174 Maintaining interoperability
175 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176
177 Interoperability with RhodeCode 2.2.X installations is provided so you don't
178 have to immediately commit to switching to Kallithea. This option will most
179 likely go away once the two projects have diverged significantly.
180
181 To run Kallithea on a RhodeCode database, run::
182
183 echo "BRAND = 'rhodecode'" > kallithea/brand.py
184
185 This location will depend on where you installed Kallithea. If you installed
186 via::
187
188 python2 setup.py install
189
190 then you will find this location at
191 ``$VIRTUAL_ENV/lib/python2.7/site-packages/Kallithea-0.1-py2.7.egg/kallithea``.
192
193 One-time conversion
194 ^^^^^^^^^^^^^^^^^^^
195
167
196 Alternatively, if you would like to convert the database for good, you can use
168 Kallithea 0.3.2 and earlier supports migrating from an existing RhodeCode
197 a helper script provided by Kallithea. This script will operate directly on the
169 installation. To migrate, install Kallithea 0.3.2 and follow the
198 database, using the database string you can find in your ``production.ini`` (or
170 instructions in the 0.3.2 README to perform a one-time conversion of the
199 ``development.ini``) file. For example, if using SQLite::
171 database from RhodeCode to Kallithea, before upgrading to this version
200
172 of Kallithea.
201 cd /path/to/kallithea
202 cp /path/to/rhodecode/rhodecode.db kallithea.db
203 pip install sqlalchemy-migrate
204 python2 kallithea/bin/rebranddb.py sqlite:///kallithea.db
205
206 .. Note::
207
208 If you started out using the branding interoperability approach mentioned
209 above, watch out for stray brand.pyc after removing brand.py.
210
211 Git hooks
212 ^^^^^^^^^
213
214 After switching to Kallithea, it will be necessary to update the Git_ hooks in
215 your repositories. If not, the Git_ hooks from RhodeCode will still be called,
216 which will cause ``git push`` to fail every time.
217
218 If you do not have any custom Git_ hooks deployed, perform the following steps
219 (this may take some time depending on the number and size of repositories you
220 have):
221
222 1. Log-in as an administrator.
223
224 2. Open page *Admin > Settings > Remap and Rescan*.
225
226 3. Turn on the option **Install Git Hooks**.
227
228 4. Turn on the option **Overwrite existing Git hooks**.
229
230 5. Click on the button **Rescan Repositories**.
231
232 If you do have custom hooks, you will need to merge those changes manually. In
233 order to get sample hooks from Kallithea, the easiest way is to create a new Git_
234 repository, and have a look at the hooks deployed there.
235
173
236
174
237 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
175 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
@@ -7,6 +7,13 b' Upgrading Kallithea'
7 This describes the process for upgrading Kallithea, independently of the
7 This describes the process for upgrading Kallithea, independently of the
8 Kallithea installation method.
8 Kallithea installation method.
9
9
10 .. note::
11 If you are upgrading from a RhodeCode installation, you must first
12 install Kallithea 0.3.2 and follow the instructions in the 0.3.2
13 README to perform a one-time conversion of the database from
14 RhodeCode to Kallithea, before upgrading to the latest version
15 of Kallithea.
16
10
17
11 1. Stop the Kallithea web application
18 1. Stop the Kallithea web application
12 -------------------------------------
19 -------------------------------------
@@ -44,28 +44,18 b' CONFIG = {}'
44 # Linked module for extensions
44 # Linked module for extensions
45 EXTENSIONS = {}
45 EXTENSIONS = {}
46
46
47 # BRAND controls internal references in database and config to the products
48 # own name.
49 #
50 # NOTE: If you want compatibility with a database that was originally created
51 # for use with the RhodeCode software product, change BRAND to "rhodecode",
52 # either by editing here or by creating a new file:
53 # echo "BRAND = 'rhodecode'" > kallithea/brand.py
54
55 BRAND = "kallithea"
56 try:
47 try:
57 from kallithea.brand import BRAND
48 import kallithea.brand
58 except ImportError:
49 except ImportError:
59 pass
50 pass
60
51 else:
61 # Prefix for the ui and settings table names
52 assert False, 'Database rebranding is no longer supported; see README.'
62 DB_PREFIX = (BRAND + "_") if BRAND != "kallithea" else ""
63
53
64 # Users.extern_type and .extern_name value for local users
54 # Users.extern_type and .extern_name value for local users
65 EXTERN_TYPE_INTERNAL = BRAND if BRAND != 'kallithea' else 'internal'
55 EXTERN_TYPE_INTERNAL = 'internal'
66
56
67 # db_migrate_version.repository_id value, same as kallithea/lib/dbmigrate/migrate.cfg
57 # db_migrate_version.repository_id value, same as kallithea/lib/dbmigrate/migrate.cfg
68 DB_MIGRATIONS = BRAND + "_db_migrations"
58 DB_MIGRATIONS = "kallithea_db_migrations"
69
59
70 try:
60 try:
71 from kallithea.lib import get_current_revision
61 from kallithea.lib import get_current_revision
@@ -44,8 +44,6 b' from paste.script.command import Command'
44 from webhelpers.text import collapse, remove_formatting, strip_tags
44 from webhelpers.text import collapse, remove_formatting, strip_tags
45 from beaker.cache import _cache_decorate
45 from beaker.cache import _cache_decorate
46
46
47 from kallithea import BRAND
48
49 from kallithea.lib.vcs.utils.hgcompat import ui, config
47 from kallithea.lib.vcs.utils.hgcompat import ui, config
50 from kallithea.lib.vcs.utils.helpers import get_scm
48 from kallithea.lib.vcs.utils.helpers import get_scm
51 from kallithea.lib.vcs.exceptions import VCSError
49 from kallithea.lib.vcs.exceptions import VCSError
@@ -366,8 +364,6 b" def make_ui(read_from='file', path=None,"
366 for ui_ in hg_ui:
364 for ui_ in hg_ui:
367 if ui_.ui_active:
365 if ui_.ui_active:
368 ui_val = safe_str(ui_.ui_value)
366 ui_val = safe_str(ui_.ui_value)
369 if ui_.ui_section == 'hooks' and BRAND != 'kallithea' and ui_val.startswith('python:' + BRAND + '.lib.hooks.'):
370 ui_val = ui_val.replace('python:' + BRAND + '.lib.hooks.', 'python:kallithea.lib.hooks.')
371 log.debug('settings ui from db: [%s] %s=%s', ui_.ui_section,
367 log.debug('settings ui from db: [%s] %s=%s', ui_.ui_section,
372 ui_.ui_key, ui_val)
368 ui_.ui_key, ui_val)
373 baseui.setconfig(safe_str(ui_.ui_section), safe_str(ui_.ui_key),
369 baseui.setconfig(safe_str(ui_.ui_section), safe_str(ui_.ui_key),
@@ -43,7 +43,6 b' from webob.exc import HTTPNotFound'
43
43
44 from pylons.i18n.translation import lazy_ugettext as _
44 from pylons.i18n.translation import lazy_ugettext as _
45
45
46 from kallithea import DB_PREFIX
47 from kallithea.lib.exceptions import DefaultUserException
46 from kallithea.lib.exceptions import DefaultUserException
48 from kallithea.lib.vcs import get_backend
47 from kallithea.lib.vcs import get_backend
49 from kallithea.lib.vcs.utils.helpers import get_scm
48 from kallithea.lib.vcs.utils.helpers import get_scm
@@ -165,7 +164,7 b' class BaseModel(object):'
165 }
164 }
166
165
167 class Setting(Base, BaseModel):
166 class Setting(Base, BaseModel):
168 __tablename__ = DB_PREFIX + 'settings'
167 __tablename__ = 'settings'
169 __table_args__ = (
168 __table_args__ = (
170 _table_args_default_dict,
169 _table_args_default_dict,
171 )
170 )
@@ -328,7 +327,7 b' class Setting(Base, BaseModel):'
328
327
329
328
330 class Ui(Base, BaseModel):
329 class Ui(Base, BaseModel):
331 __tablename__ = DB_PREFIX + 'ui'
330 __tablename__ = 'ui'
332 __table_args__ = (
331 __table_args__ = (
333 # FIXME: ui_key as key is wrong and should be removed when the corresponding
332 # FIXME: ui_key as key is wrong and should be removed when the corresponding
334 # Ui.get_by_key has been replaced by the composite key
333 # Ui.get_by_key has been replaced by the composite key
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now