Translate Toolkit & Pootle

Tools to help you make your software local

User Tools


Migration

This page describes how to migrate data (languages, projects, and users) from an old Pootle 1.2 installation to the new Django-based Pootle 2.0. This is a special type of Pootle upgrade, since there were many changes between these versions.

Migration script

Bundled with Pootle source code, under the pootle/tools/ directory there is a script called import_old_prefs.py which does the dirty job of importing the old data from the .prefs files into the new Django-based database.

Before you start

In order to proceed with the migration, first of all you need to copy the translation files (PO, XLIFF) from the old Pootle server to the new location of the files (in case it has changed).

You will also need to have located the pootle.prefs and users.prefs files. They can usually be found under /etc/pootle/ in Debian installations. Alternatively you can copy these files to your working directory.

Proceeding with the migration

Once you get to this point, you will need to create the minimal database structure to after fill in the data. So change your current directory to Pootle's source root and run:

$ python manage.py syncdb --noinput

This will create all the necessary tables in the database.

Finally, you can run the migration script as follows:

$ python import_pootle_prefs /path/to/old/pootle.prefs /path/to/old/users.prefs

Depending on your previous Pootle installation this may take a while.

If you are worried because the console is flooded by messages, don't worry, the script is a little bit verbose, so that's the expected behaviour.

Now, before you can start browsing to the Pootle front page, and in case of using SQLite as your database backend, you need to make sure that the pootle.db file under the dbs directory is writable by the user running the Apache process.

Lastly, if your setup is fine, you can access Pootle using your web browser. Please note that the first time you try to access the main page Pootle needs to calculate all the stats so this may take some time. This only happens on the first time.

Alternatively, if your Pootle installation is big and you're worried about your browser's timeout when calculating statistics, you can run the manage.py refresh_stats command from the shell.

Once your migration is done, you can delete all the files ending with .prefs extension. Those files are not used anymore because that information now resides in the database.

Known issues

Limitation in user's names

Since Django's built-in User model has a limitation of 30 characters and asks for first and last names, names longer than 30 characters won't be imported as they were.

If the name is less than 30 characters length, it will be stored as-is in the first_name field.
Otherwise, the name will be split by spaces and the first 30 characters will be part of the first_name field. The remaining characters (also up to 30 characters) will be stored in the last_name field.

Permissions

Since the way permissions are stored and handled has changed in Pootle 2.0, they are not imported. You will need to reset your settings manually.