Giter VIP home page Giter VIP logo

modoboa-mail-migration's Introduction

Aid to re-hosting modoboa+roundcubemail to new server with latest Modoboa

Install Modoboa on NEW server

Follow the Modoboa install instructions

Install Roundcubemail on NEW server

Follow the roundcubemail install instructions.

Roundcube install is so "one and done" (like Modoboa) in my experience. This article was helpful.

Create ~/.pgpass on NEW and OLD servers with 4 entries

localhost:5432:roundcubemail:roundcube:CHANGEME
localhost:5432:modoboa:modoboa:CHANGEME
localhost:5432:amavis:amavis:CHANGEME
localhost:5432:spamassassin:spamassassin:CHANGEME

Where to find passwords on OLD and NEW server

  • modoboa, amavis: /srv/modoboa/instance/instance/settings.py
  • roundcubemail: <roundcubemail>/config/config.inc.php

Stop services on NEW server

make stop-services

Stop services on OLD server

make stop-services

Dump databases on OLD server and copy to NEW server

make dump
rsync -azP OLD:modoboa-mail-migration/dumps .

Restore databases (with workaround for 1.17.0 -> 2.0.0)

See Upgrade from 1.17.0 to 2.0.0 fails - psycopg2.errors.FeatureNotSupported: cannot alter type of a column used by a view or rule.

make restore
make drop-dkim-view

Complete Modoboa upgrade on NEW servier

See Modoboa upgrade instructions for reference. Since the NEW server is built with latest Modoboa you should just need

sudo -u <modoboa_user> -i bash
source <virtuenv_path>/bin/activate
cd <modoboa_instance_dir>
python manage.py migrate
python manage.py collectstatic
python manage.py check --deploy
exit

Recreate dkim view (if needed)

make create-dkim-view

Sync vmail from OLD server to NEW server

Create a domains.make with a list of domains to sync, e.g.,

DOMAINS := \
	domain.com

You can rerun this as needed if mail is still being delivered to OLD server

make sync-mail

Dkim keys

sudo bash
scp -r morison.io:dkim/\* /var/lib/dkim
chown opendkim:opendkim /var/lib/dkim/*

Start it up again and test, test, test

make start-services

Debug, debug, debug

Likely something will be broken with Modoboa and/or Roundcubemail. Places to look:

  • /var/log/mail.log
  • /var/log/nginx/*.log
  • /var/log/uwsgi/app/*.log

You might need to temporarily change DEBUG = True in -/srv/modoboa/instance/instance/settings.py and sudo systemctl restart uwsgi to get debug messages in the browser. Be sure to revert asap when done.

DNS

For debug, it's useful to iron things out with a scratch domain, like mail-test.domain.com. For the live migration, you'll need to change MX for the domains to the NEW server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.