question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Impacted versions

  • Modoboa: 1.9.1
  • installer used: Yes
  • Webserver: Nginx

Hi. Hi, I would like to upgrade modoboa but, let’s be clear, I don’t understand anything! As much as the installation script is simple, the update procedure is really difficult…

If I try to do it: python manage. py generate_postfix_maps --force --destdir /etc/postfix/ This is my mistake:

Traceback (most recent call last):
  File "manage. py", line 17, in <module>
    "Couldn't import Django. Are you sure it's installed and "
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

I’m probably supposed to do these orders:

source <virtuenv_path>/bin/activate

But what to replace <virtuenv_path>? I used the installer, I have no idea what to do! I replaced <modoboa_user> by modoboa because I have a modoboa user, I guess it’s him…

Thank you in advance for your help.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
CooperBarrettcommented, Feb 6, 2018

Finally!!! I finally managed to update Modoboa to 1.10.0. Honestly, I find the doc is not super clear, especially for a beginner like me. I’ll try to give my steps to get there.

Information : I’m on Debian Stretch I used the modoboa installer I left from modoboa 1.9.1 I am a beginner, do not necessarily take these instructions literally, I put it only to give indications to those who like me had difficulty finding my way in the doc.

Steps

We use the modoboa user :

sudo -u modoboa -i
bash
source env/bin/activate

Normally you should see (env) appear in front of it. Then we update the extensions:

pip install modoboa-amavis==1.2.0
pip install modoboa-contacts==0.5.0
pip install modoboa-dmarc==1.1.0
pip install modoboa--imap-migration==1.2.0
pip install modoboa-pdfcredentials==1.3.0
pip install modoboa-postfix-autoreply==1.4.0
pip install modoboa-radicale==1.2.0
pip install modoboa-sievefilters==1.4.0
pip install modoboa-stats==1.4.0
pip install modoboa-webmail==1.4.0

We will now follow the instructions of the doc: http://modoboa.readthedocs.io/en/latest/upgrade.html#specific-upgrade-instructions nano instance/instance/settings.py Add 'modoboa.transport' to MODOBOA_APPS:

MODOBOA_APPS = (
   'modoboa',
   'modoboa.core',
   'modoboa.lib',
   'modoboa.admin',
   'modoboa.transport',
   'modoboa.relaydomains',
   'modoboa.limits',
   'modoboa.parameters',
)

Replace the following line:

MIDDLEWARE_CLASSES = (

by:

MIDDLEWARE = (

Exit the user modoboa.

exit
exit

Double exit because we used bash.

cd /srv/modoboa/instance/

sudo rm -f /etc/postfix/modoboa-postfix-maps.chk
sudo /srv/modoboa/env/bin/python manage.py generate_postfix_maps --force --destdir /etc/postfix/

We modify the configuration of postfix : sudo nano /etc/postfix/main.cf

smtpd_sender_login_maps =
  proxy:pgsql:/etc/postfix/sql-sender-login-map.cf

transport_maps =
  pgsql:/etc/postfix/sql-transport.cf
  pgsql:/etc/postfix/sql-spliteddomains-transport.cf

If transport_maps contains sql-relaydomains-transport.cf, remove it.

We’re restarting postfix: sudo service postfix restart

Modify the modoboa crontab : sudo nano /etc/cron.d/modoboa Add the following cron job at the end :

# Generate DKIM keys (they will belong to the user running this job)
*       *       *       *       *       root    $PYTHON $INSTANCE/manage.py modo manage_dkim_keys

Update Modoboa We’re going back to modoboa user :

sudo -u modoboa -i
bash
source env/bin/activate

And we do the update plus the migration of modoboa :

cd
pip install modoboa==1.10.0
cd instance
python manage.py migrate
python manage.py collectstatic
python manage.py check --deploy

And we restart the server. Normally, everything should be okay.

0reactions
Cr4shOv3rrid3commented, Aug 23, 2022

Do you have this question? (modoboa-amavis.W001) AMAVIS_DEFAULT_DATABASE_ENCODING does not match the character encoding used by the Amavis database.

to fix this issue pretending you did follow everything through with the modoboa user and activated virtual environment

in modoboa folder you will find a hidden folder named “.local” (without quotes)

this is due to using virtual environment on top of modoboa user

it makes sure everything that runs is installed there in your appropriate python3.x/site-packages folder inside and through that hidden location.

now switch inside that folder to modoboa-amavis folder inside you will find settings.py file

now inside that file you will find following entry

settings[“AMAVIS_DEFAULT_DATABASE_ENCODING”] = “UTF8”

i just already changed it into UTF8 from something like LATIN1 make sure you did the same and you will no longer get those annoying encoding warnings.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I contact Upgrade?
How can I contact Upgrade? ; Need help on one of your accounts? I need help making a payment; I want to change...
Read more >
Upgrade - Personal Loans, Cards and Rewards Checking
Need Help? · support@upgrade.com · (844) 319-3909 · Monday - Friday, 5am - 7pm PT · Saturday - Sunday, 6am - 5pm PT....
Read more >
Upgrade Personal Loans: 2022 Review - Bankrate.com
Upgrade's customer service team is available by emailing support@upgrade.com or toll-free at 844-319-3909. The customer service hours are ...
Read more >
Helm Upgrade
This command upgrades a release to a new version of a chart. ... --help help for upgrade --history-max int limit the maximum number...
Read more >
Upgrade to macOS Ventura - Official Apple Support
Learn more about how to upgrade to macOS Ventura. Upgrading to Ventura helps you get more done, collaborate in your favorite apps, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found