Upgrading Weblate¶
Generic upgrade instructions¶
Before upgrading, please check the current Software requirements as they might have
changed. Once all requirements are installed or updated, please adjust your
settings.py
to match changes in the configuration (consult
settings_example.py
for correct values).
Always check Version specific instructions before upgrade. In case you are skipping some versions, please follow instructions for all versions you are skipping in the upgrade. Sometimes it’s better to upgrade to some intermediate version to ensure a smooth migration. Upgrading across multiple releases should work, but is not as well tested as single version upgrades.
Примечание
It is recommended to perform a full database backup prior to upgrade so that you can roll back the database in case upgrade fails.
Upgrade configuration file, refer to
settings_example.py
or Version specific instructions for needed steps.Upgrade database structure:
./manage.py migrate --noinput
Collect updated static files (mostly javacript and CSS):
./manage.py collectstatic --noinput
Update language definitions (this is not necessary, but heavily recommended):
./manage.py setuplang
Optionally upgrade default set of privileges definitions (you might want to add new permissions manually if you have heavily tweaked access control):
./manage.py setupgroups
If you are running version from Git, you should also regenerate locale files every time you are upgrading. You can do this by invoking:
./manage.py compilemessages
Изменено в версии 1.2: Since version 1.2 the migration is done using South module, to upgrade to 1.2, please see Version specific instructions.
Изменено в версии 1.9: Since version 1.9, Weblate also supports Django 1.7 migrations, please check Upgrading to Django 1.7 for more information.
Изменено в версии 2.3: Since version 2.3, Weblate supports only Django native migrations, South is no longer supported, please check Upgrading to Django 1.7 for more information.
Изменено в версии 2.11: Since version 2.11, there is reduced support for migrating from older non-released versions. In case you hit problem in this, please upgrade first to the closest release version and then continue in upgrading to latest one.
Изменено в версии 2.12: Since version 2.12, upgrade is not supported for versions prior to 2.2. In case you are upgrading from such old version, please upgrade to 2.2 first and then continue in upgrading to current release.
Изменено в версии 3.0: If you are upgrading from 2.x release, always first upgrade to 3.0 (see Upgrade from 2.20 to 3.0) and the continue ugprading in the 3.x series. Upgrades skipping this step are not supported.
Version specific instructions¶
Upgrade from 0.5 to 0.6¶
On upgrade to version 0.6, you should run ./manage.py syncdb
and
./manage.py setupgroups --move
to setup access control as described
in the installation section.
Upgrade from 0.6 to 0.7¶
On upgrade to version 0.7, you should run ./manage.py syncdb
to
setup new tables and ./manage.py rebuild_index
to build the index for
fulltext search.
Upgrade from 0.7 to 0.8¶
On upgrade to version 0.8, you should run ./manage.py syncdb
to set up
new tables, ./manage.py setupgroups
to update privileges setup and
./manage.py rebuild_index
to rebuild index for fulltext search.
Upgrade from 0.8 to 0.9¶
On upgrade to version 0.9, file structure has changed. You need to move
repos
and whoosh-index
to weblate
folder. Also running
./manage.py syncdb
, ./manage.py setupgroups
and
./manage.py setuplang
is recommended to get latest updates of
privileges and language definitions.
Upgrade from 0.9 to 1.0¶
On upgrade to version 1.0, one field has been added to database, you need to invoke the following SQL command to adjust it:
ALTER TABLE `trans_subproject` ADD `template` VARCHAR(200);
Upgrade from 1.0 (1.1) to 1.2¶
On upgrade to version 1.2, the migration procedure has changed. It now uses South for migrating database. To switch to this new migration schema, you need to run following commands:
./manage.py syncdb
./manage.py migrate trans 0001 --fake
./manage.py migrate accounts 0001 --fake
./manage.py migrate lang 0001 --fake
Also please note that there are several new requirements and version 0.8 of django-registration is now being required, see Software requirements for more details.
Once you have done this, you can use Generic upgrade instructions.
Upgrade from 1.2 to 1.3¶
Since 1.3, settings.py
is not shipped with Weblate, but only example
settings as settings_example.py
; it is recommended to use it as new base
for your setup.
Upgrade from 1.4 to 1.5¶
Several internal modules and paths have been renamed and changed, please adjust
your settings.py
to match (consult settings_example.py
for
correct values).
- Many modules lost their
weblate.
prefix. - Checks were moved to submodules.
- Locales were moved to top level directory.
The migration of database structure to 1.5 might take quite long; it is recommended to put your site offline while the migration is going on.
Примечание
If you have update in same directory, stale *.pyc
files might be
left around and cause various import errors. To recover from this, delete
all of them in Weblate’s directory, for example by
find . -name '*.pyc' -delete
.
Upgrade from 1.6 to 1.7¶
The migration of database structure to 1.7 might take quite long, it is recommended to put your site offline while the migration is going on.
If you are translating monolingual files, it is recommended to rerun quality checks as they might have been wrongly linked to units in previous versions.
Upgrade from 1.7 to 1.8¶
The migration of database structure to 1.8 might take quite long, it is recommended to put your site offline while the migration is going on.
Authentication setup has been changed and some internal modules have changed
name, please adjust your settings.py
to match (consult
settings_example.py
for correct values).
Also please note that there are several new requirements, see Software requirements for more details.
Upgrade from 1.8 to 1.9¶
Several internal modules and paths have been renamed and changed, please adjust
your settings.py
to match (consult settings_example.py
for
correct values).
См.также
If you are upgrading to Django 1.7 at the same time, please consult Upgrading to Django 1.7.
Upgrade from 1.9 to 2.0¶
Several internal modules and paths have been renamed and changed, please adjust
your settings.py
to match (consult settings_example.py
for
correct values).
This upgrade also requires you to upgrade python-social-auth from 0.1.x to 0.2.x series, which will most likely need to fake one of their migrations (see Upgrading PSA with South for more information):
./manage.py migrate --fake default
См.также
If you are upgrading to Django 1.7 at the same time, please consult Upgrading to Django 1.7.
Upgrade from 2.0 to 2.1¶
The filesystem paths configuration has changed, the GIT_ROOT
and
WHOOSH_INDEX
are gone and now all data resides in
DATA_DIR
. The existing data should be automatically migrated by the
supplied migration, but in case of non standard setup, you might need to move
these manually.
См.также
If you are upgrading to Django 1.7 at the same time, please consult Upgrading to Django 1.7.
Upgrade from 2.1 to 2.2¶
Weblate now supports fulltext search on additional fields. In order to make it work on existing data you need to update fulltext index by:
./manage.py rebuild_index --clean --all
If you have some monolingual translations, Weblate now allows editing of template (source) strings as well. To see them, you need to reload translations, which will either happen automatically on te next repository update or you can force it manually:
./manage.py loadpo --all
См.также
If you are upgrading to Django 1.7 at the same time, please consult Upgrading to Django 1.7.
Upgrade from 2.2 to 2.3¶
If you have not yet performed upgrade to Django 1.7 and newer, first upgrade to 2.2 following the instructions above. Weblate 2.3 no longer supports migration from Django 1.6.
If you were using Weblate 2.2 with Django 1.6, you will now need to fake some migrations:
./manage.py migrate --fake accounts 0004_auto_20150108_1424
./manage.py migrate --fake lang 0001_initial
./manage.py migrate --fake trans 0018_auto_20150213_1447
Previous Weblate releases contained a bug which made some monolingual translations behave inconsistently for fuzzy and untranslated strings, if you have such, it is recommended to run:
./manage.py fixup_flags --all
См.также
Upgrade from 2.3 to 2.4¶
Handling of static content has been rewritten, please adjust configuration of your webserver accordingly (see Serving static files for more details). Most importantly:
/media/
path is no longer used/static/
path now holds both admin and Weblate static files
There is now also additional dependency - django_compressor
, please install
it prior to upgrading.
См.также
Upgrade from 2.4 to 2.5¶
The fulltext index has been changed, so unless you rebuild it, the fulltext search will not work. To rebuild it, execute:
./manage.py rebuild_index --clean --all
См.также
Upgrade from 2.5 to 2.6¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- new dependecy on Django REST Framework, see Software requirements
- example configuration now configures Django REST Framework, please adjust your settings accordingly
- the USE_TZ settings is now enabled by default
Примечание
Weblate now relies much more on having the correct site name in the database, please see Set correct site name for instructions how to set it up.
См.также
Upgrade from 2.6 to 2.7¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- new optional dependency on python-bidi, see Software requirements
- Google Web Translation was removed, remove it from your configuration
См.также
Upgrade from 2.7 to 2.8¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- new dependency on defusedxml, see Software requirements
- there is new quality check: Invalid XML markup
См.также
Upgrade from 2.8 to 2.9¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- The addition of media storage to
DATA_DIR
.
См.также
Upgrade from 2.9 to 2.10¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- The
INSTALLED_APPS
now should includeweblate.utils
. - There is new check in default set (
SamePluralsCheck
). - There is change in
SOCIAL_AUTH_PIPELINE
default settings. - You might want to enable optional Git exporter.
- There is new
RemoveControlChars
in defaultAUTOFIX_LIST
. - If you are using Microsoft Translator, please replace Microsoft Translator with Microsoft Cognitive Services Translator; Microsoft has changed authentication scheme.
См.также
Upgrade from 2.10 to 2.11¶
In case you have been using python-social-auth 0.2.21 with Weblate 2.10 you can follow generic upgrade instructions, otherwise please read warning below.
Notable configuration or dependencies changes:
- There is new recommended value for
SOCIAL_AUTH_SLUGIFY_FUNCTION
. - There is change in
MIDDLEWARE_CLASSES
setting. - The
python-social-auth
module has been deprecated upstream, Weblate now usessocial-auth-core
andsocial-auth-app-django
instead. You also have to adjustsettings.py
as several modules have been moved fromsocial
to eithersocial_core
orsocial_django
. Please consultsettings_example.py
for correct values.
Предупреждение
If you were using python-social-auth 0.2.19 or older with Weblate 2.10, you should first upgrade Weblate 2.10 to python-social-auth 0.2.21 and then perform upgrade to Weblate 2.11. Otherwise you end up with non applicable database migrations.
See Migrating from python-social-auth to split social for more information.
If you are upgrading from older version, you should first upgrade to Weblate 2.10 and python-social-auth 0.2.21 and then continue in upgrading.
См.также
Upgrade from 2.11 to 2.12¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- The database migration will take quite long on this update as all translation units stored in database have to be updated. Expect about 1 hour of migration for 500000 translation units (depends on hardware and database).
- There is new dependency on
django-appconf
andsiphashc3
. - The setting for
UNAUTHENTICATED_USER
forREST_FRAMEWORK
has been changed to properly handle anonymous user permissions in REST API. - The
INSTALLED_APPS
now should includeweblate.screenshots
. - There is new optional dependency on tesserocr, see Software requirements.
См.также
Upgrade from 2.12 to 2.13¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- There is new quality check: Has been translated.
- The
INSTALLED_APPS
now should includeweblate.permissions
. - The per project ALCs are now implemented using Group ACL, you might need to adjust your setup if you were using Group ACLs before.
- There are several new permissions which should be assigned to default groups,
you should run
./manage.py setupgroups
to update them. Alternatively, you might want to add the following permissions where applicable: * Can access VCS repository * Can access project
Примечание
If you have update in same directory, stale *.pyc
files might be
left around and cause various import errors. To recover from this, delete
all of them in Weblate’s directory, for example by
find . -name '*.pyc' -delete
.
См.также
Upgrade from 2.13 to 2.14¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- There is new middleware
weblate.middleware.SecurityMiddleware
in the default configuration, see Content security policy for more details. - Weblate now uses Django password validation, it’s controlled by
AUTH_PASSWORD_VALIDATORS
setting. - Weblate now customizes disconnect pipeline for Python Social Auth,
the
SOCIAL_AUTH_DISCONNECT_PIPELINE
setting is now needed. - There is change in
SOCIAL_AUTH_PIPELINE
default settings. - All pending email verifications will be invalid due to validation change.
- The authentication attempts are now rate limited, see Rate limiting for more details.
См.также
Upgrade from 2.14 to 2.15¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- The
AUTHENTICATION_BACKENDS
setting should be changed to includesocial_core.backends.email.EmailAuth
as shipped by Python Social Auth. Weblate no longer uses own email auth backend.
См.также
Upgrade from 2.15 to 2.16¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- There is change in
SOCIAL_AUTH_PIPELINE
default settings. - The
weblate.wladmin
should now be first in theINSTALLED_APPS
settings.
См.также
Upgrade from 2.16 to 2.17¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- There is new validator included in default
AUTH_PASSWORD_VALIDATORS
setting. - The
siphashc3
dependency has been replaced bysiphashc
. - The default value for
BASE_DIR
setting has been changed to match Django default value. You might have to adjust some paths in the configuration as several default values are based on this (eg.DATA_DIR
orTTF_PATH
). - There is change in
SOCIAL_AUTH_PIPELINE
default settings.
См.также
Upgrade from 2.17 to 2.18¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- Django 1.11 is now required.
- The MIDDLEWARE_CLASSES is now
MIDDLEWARE
with several changes. - The
SPECIAL_CHARS
now lists actual chars now. - There is change in default value for
TEMPLATES
setting. - There are several new permissions which should be assigned to default groups,
you should run
./manage.py setupgroups
to update them. Alternatively, you might want to add the following permissions where applicable: * Can review translation - Weblate now needs database to be configured with
ATOMIC_REQUESTS
enabled.
См.также
Upgrade from 2.18 to 2.19¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- There is new dependency on the
user_agents
module. - There is change in the
MIDDLEWARE
setting (addedweblate.wladmin.middleware.ConfigurationErrorsMiddleware
). - There is change in the
INSTALLED_APPS
setting (addedweblate.langdata
andweblate.addons
). - Several shipped hook scripts are replaced by addons. The migration will happen automatically.
There has been change in default plural rules for some languages to closer follow CLDR specification. You might want to reimort those to avoid possible consistency problems:
./manage.py loadpo --all --lang dsb
./manage.py loadpo --all --lang he
./manage.py loadpo --all --lang hsb
./manage.py loadpo --all --lang kw
./manage.py loadpo --all --lang lt
./manage.py loadpo --all --lang lv
См.также
Upgrade from 2.19 to 2.20¶
Please follow Generic upgrade instructions in order to perform update.
Notable configuration or dependencies changes:
- There is new dependency on the
filelock
module. - The two internal machine translation services are now merged, please adjust
MACHINE_TRANSLATION_SERVICES
to no longer includeweblate.machinery.weblatetm.WeblateSimilarTranslation
. - There is a change in
REST_FRAMEWORK
setting to supportBearer
authentication. - The translate-toolkit 2.3.0 is now required.
- There is change in the
INSTALLED_APPS
setting (addedweblate.memory
). - There is new built in translation memory machine translation, the
MACHINE_TRANSLATION_SERVICES
should now includeweblate.memory.machine.WeblateMemory
.
См.также
Upgrade from 2.20 to 3.0¶
Предупреждение
Please follow carefully following instructions. It is extremely recommended to backup your database prior to this upgrade.
Notable configuration or dependencies changes:
- Several modules have been renamed and this lead to changes in many settings,
please consult
settings_example.py
for current values. - Several dependencies have raised minimal version.
- The setting
MACHINE_TRANSLATION_SERVICES
was renamed toMT_SERVICES
. - The Access control is completely rewritten, you might have to adjust privileges you have manually assigned.
- The per component scripts are no longer supported, please use addons instead, see Executing scripts from addon for more details.
- Users now need to have unique emails. This was assumed before, but the check was not enforced in all places (eg. in the admin interface in older version). You will get a migration error if there are more users using same email.
Upgrading steps:
- It is recommended to upgrade to 2.20 first, see Upgrade from 2.19 to 2.20.
- Backup your database and Weblate.
- Stop web server and any background jobs using Weblate.
- Update the configuration file to match
settings_example.py
. - Comment out
AUTH_USER_MODEL
in the configuration. - Run first authentication migration:
./manage.py migrate weblate_auth 0001
- Bring back setting for
AUTH_USER_MODEL
. - Run rest of migrations:
./manage.py migrate
After upgrading:
- All existing users and groups have been migrated to new model.
- Any per user permissions are removed, please assign users to appropriate groups and roles to grant them permissions.
- Any custom groups will not have any permissions after upgrade, please grant the permissions again.
См.также
Upgrading to Django 1.7¶
Изменено в версии 2.3: This migration is supported only in Weblate 2.2, in case you are upgrading from some older version, you will have to do intermediate update to 2.2.
Django 1.7 has a new feature to handle database schema upgrade called «migrations» which is incompatible with South (used before by Weblate).
Before migrating to Django 1.7, you first need to apply all migrations from
South. If you already have upgraded Django to 1.7, you can do this using
virtualenv and examples/migrate-south
script:
examples/migrate-south --settings weblate.settings
Once you have done that, you can run Django migrations and work as usual. For the initial setup, you might need to fake some of the migrations though:
./manage.py migrate --fake-initial
Upgrading from Python 2.x to 3.x¶
The upgrade from Python 2.x to 3.x, should work without major problems. Take care about some changed module names when installing dependencies (eg. pydns vs. py3dns).
The Whoosh index has to be rebuilt as it’s encoding depends on Python version, you can do that using following command:
./manage.py rebuild_index --clean --all
Migrating from Pootle¶
As Weblate was originally written as replacement from Pootle, it is supported
to migrate user accounts from Pootle. All you need to do is to copy
auth_user
table from Pootle, user profiles will be automatically created
for users as they log in and they will be asked to update their settings.
Alternatively you can use importusers
to import dumped user
credentials.