Translations of this page?:

Pootle database migration

The default configuration for Pootle uses SQLite which is not really suited for production use. If you started using SQLite and want to migrate to another database system such as MySQL or PostgreSQL without recreating existing data, you can perform a database migration using the steps described on this page.

A database migration is possible since Pootle 2.1.1 (or 2.0.6). This migration will only work with Django 1.2 or later.

In summary, two manage.py commands are needed:

./manage.py dumpdata -n > data.json

This saves all the content of the database as a JSON file

./manage.py loaddata ./data.json

This reads all the data in the JSON file and creates the corresponding database records.

The steps to migrate between databases are as follows:

  1. Make complete backups of all your files, settings and databases
  2. Ensure that you have at least Pootle 2.0.6 or Pootle 2.1.1
  3. Don't change the version of Pootle at any stage during this process
  4. Ensure that you have at least Django 1.2.0
  5. Read about how to run manage.py commands
  6. Stop the Pootle server to avoid data changing while you migrate
  7. Leave current settings in tact and dump the data using the dumpdata command, note the -n option is required
  8. Create a new database for Pootle (MySQL instructions) and change localsettings.py to point at this database
  9. Initialize the database using the ./manage.py syncdb command
  10. Load the data using the loaddata command
  11. Restart the server; you should be running under the new database now

Note that Pootle 2.1 database can be very large. Dumping and loading data will take long and require lots of RAM. If you have a 2.0 install it is better to migrate the database first and then upgrade to 2.1, since the 2.0 database is relatively small.

pootle/database_migration.txt · Last modified: 2011/08/25 10:42 by friedelwolff
Recent changes RSS feed GNU General Public License Driven by DokuWiki Get Pootle, Virtaal & the Translate Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads