modoboa / modoboa-imap-migration

An extension to ease the migration between 2 IMAP servers using offlineimap
ISC License
16 stars 12 forks source link

Empty modoboa_imap_migration_migration table #1

Closed jltignon closed 8 years ago

jltignon commented 8 years ago

Hello,

My first message : thank your for the good job.

Probably more a question than an issue : I'm trying to use modoboa-imap-migration to migrate a modoboa 1.1 instance to a 1.3.5 on another server with no luck.

The domains/identities and aliases export/import have been done without any errors. Problem is : generate_offlineimap_config script does not detect any account to migrate. The modoboa_imap_migration_migration MySQL table is empty.

The modoboa modules versions on the destination server are : modoboa (1.3.5) modoboa-admin (1.1.2) modoboa-admin-limits (1.0.2) modoboa-admin-relaydomains (1.1.0) modoboa-amavis (1.0.3) modoboa-imap-migration (1.0.3) modoboa-pdfcredentials (1.0.0) modoboa-postfix-autoreply (1.1.1) modoboa-radicale (1.0.3) modoboa-sievefilters (1.0.3) modoboa-stats (1.0.2) modoboa-webmail (1.0.2)

The generated offlineimap.conf is : [general] accounts = pythonfile = ~/.offlineimap.py

Am I doing something wrong ?

tonioo commented 8 years ago

This extension needs some documentation, I'll write one asap.

jltignon commented 8 years ago

Thanks for the quick answer, I'll wait. If I can help doing something, please tell me.

tonioo commented 8 years ago

I've added some documentation, it should be easier to understand :)

jltignon commented 8 years ago

I agree, it's clearer now, thanks Antoine. generate_offlineimap_config generates an .offlineimaprc file ready to go but offlineimap fails with the following error :

ERROR: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
ERROR: Exceptions occurred during the run!

The problem seems to be related to https://docs.djangoproject.com/en/dev/releases/1.7/#standalone-scripts. I can confirm that adding the following to .offlineimap.py is a solution :

import django
django.setup()

By the way, I also found a typo in modoboa_imap_migration/views.py :

9c9
< from modoboa.lib.webutils import render_to_json_response
---
> from modoboa.lib.web_utils import render_to_json_response

Probably not the correct way for submitting corrections, sorry I'm not yet very familiar with github. Anyway, hope this helps

tonioo commented 8 years ago

Thank you for the feedback :)

jltignon commented 8 years ago

Everything works fine now, thank you for your help.