mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 17:06:01 +03:00
[GH-ISSUE #939] Help with upgrading Modoboa on Debian #806
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#806
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @abmiller99 on GitHub (Oct 13, 2016).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/939
I'm not experienced with Python, Postgre.
I have Modoboa 1.6.0 running on my mailserver . My install method was the 'easy', Python script method:
$ git clone https://github.com/modoboa/modoboa-installer$ cd modoboa-installer$ sudo ./run.py <mail server hostname>I have read the docs describing how to update modoboa with new version, but I'm stuck on the
deployinstructions.Example from the docs:
$ modoboa-admin.py deploy modoboa_example --collectstatic [--dburl default:database-url] [--extensions extensions]What do I replace
modoboa_examplewith?How do I determine my
--dburlvalues?Any help is very appreciated!
@tonioo commented on GitHub (Oct 13, 2016):
Hi,
in your case, the easiest way to upgrade is the following one:
Then, just follow the 1.6.1 instructions as described in the weblog post.
@abmiller99 commented on GitHub (Oct 13, 2016):
Here is the result of the commands you provided:
$ su - modoboa$ cd instance$ python manage.py migrate$ python manage.py collectstaticAny insights?
My environment: Debian 8 (Jessie)
@tonioo commented on GitHub (Oct 13, 2016):
Looks like the shell of the modoboa user is not bash. Please retry like this:
@tonioo commented on GitHub (Oct 13, 2016):
@abmiller99 Is it better ?
@abmiller99 commented on GitHub (Oct 13, 2016):
I semi-bricked my install and had to restore from backup.
Now I'll try again using your commands with my working v1.6.0:
root@mail ~ $ su - modoboa$ bashmodoboa@mail:~$ source env/bin/activate(env)modoboa@mail:~$ cd instance(env)modoboa@mail:~/instance$ python manage.py migrateI'll pause here for your input..
@tonioo commented on GitHub (Oct 13, 2016):
This is fine. You can continue.
Le 13 oct. 2016 5:59 PM, Andrew Miller notifications@github.com a écrit :I semi-bricked my install and had to restore from backup.
Now I'll try again using your commands with my working v1.6.0:
root@mail ~ $ su - modoboa
$ bash
modoboa@mail:~$ source env/bin/activate
(env)modoboa@mail:~$ cd instance
(env)modoboa@mail:~/instance$ python manage.py migrate
Operations to perform:
Apply all migrations: authtoken, core, limits, lib, sessions, admin, modoboa_postfix_autoreply, auth, sites, reversion, contenttypes, modoboa_amavis, relaydomains
Running migrations:
No migrations to apply.
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
I'll pause here for your input..
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
@abmiller99 commented on GitHub (Oct 13, 2016):
(env)modoboa@mail:~/instance$ python manage.py makemigrations(env)modoboa@mail:~/instance$ python manage.py migrateNow what? Restart uWSGI?
@tonioo commented on GitHub (Oct 13, 2016):
Sorry, I meant you can continue with the procedure I gave you.
Run the following commands please:
You should also remove the two migration files you created by running the "makemigrations" command. (you should find them in /srv/modoboa/env/lib/python2.7/site-packages/modoboa/core/migrations/0009_auto_20161013_1808.py and srv/modoboa/env/lib/python2.7/site-packages/modoboa/admin/migrations/0005_auto_20161013_1808.py)
Then, continue with the collectstatic command of this original procedure and finally, reload uwsgi.
@abmiller99 commented on GitHub (Oct 13, 2016):
OK -
(env)modoboa@mail:~/instance$ python manage.py migrate core 0008(env)modoboa@mail:~/instance$ python manage.py migrate admin 0004done.
(env)modoboa@mail:~/instance$ python manage.py collectstaticroot@mail ~ $ service uwsgi reloadI'm guessing that the report of
0 static files copiedmeans that I didn't do something?Modoboa still at v1.6.0.
@tonioo commented on GitHub (Oct 13, 2016):
0 static files copiedonly means there was nothing to update and it is normal with this version.Have you tried to restart uwsgi ?
@abmiller99 commented on GitHub (Oct 13, 2016):
Yes
Going back to the beginning of the update procedure - would it be correct to run the python install script first before proceeding with the commands you provided? For example:
Step 1)
Step 2)
Step 3)
$ service uwsgi reload@tonioo commented on GitHub (Oct 13, 2016):
Yes, it would be correct.
@abmiller99 commented on GitHub (Oct 14, 2016):
Still at 1.6.0
I also tried using pip install method:
pip install modoboa==1.6.1
Got lots of these:
Could not find .egg-info directory in install record for gevent==1.1.1 (from modoboa==1.6.1)Could not find .egg-info directory in install record for dnspython==1.12.0 (from modoboa==1.6.1)Could not find .egg-info directory in install record for jsonfield==1.0.3 (from modoboa==1.6.1)Could not find .egg-info directory in install record for py-dateutil==2.2 (from modoboa==1.6.1)Could not find .egg-info directory in install record for feedparser==5.2.1 (from modoboa==1.6.1)Could not find .egg-info directory in install record for cffi>=1.1 (from bcrypt==2.0.0->modoboa==1.6.1)Could not find .egg-info directory in install record for LEPL (from rfc6266->modoboa==1.6.1)Could not find .egg-info directory in install record for greenlet>=0.4.9 (from gevent==1.1.1->modoboa==1.6.1)Could not find .egg-info directory in install record for pycparser (from cffi>=1.1->bcrypt==2.0.0->modoboa==1.6.1)and quite a few warnings like:
@tonioo commented on GitHub (Oct 14, 2016):
Please make sure to run commands as
modoboauser and that the virtualenv is properly loaded (source ~/env/bin/activate).Then, can you run the following command please:
pip list | grep modoboa@abmiller99 commented on GitHub (Oct 14, 2016):
(env)modoboa@mail:~$ pip list | grep modoboa@tonioo commented on GitHub (Oct 14, 2016):
Ok. Please try the following now:
@abmiller99 commented on GitHub (Oct 14, 2016):
(env)modoboa@mail:~$ pip uninstall modoboa-admin...
Successfully uninstalled modoboa-admin-1.1.2(env)modoboa@mail:~$ pip install modoboa==1.6.1..
Successfully installed modoboa-1.6.1@tonioo commented on GitHub (Oct 14, 2016):
Looks better !
Now, upgrade map files and postfix configuration (as described in the blog post) and reload uwsgi and you'll be done.
@abmiller99 commented on GitHub (Oct 14, 2016):
python manage.py generate_postfix_maps --destdir <path> --force-overwriteHow I do know my
<path>? Is it /etc/postfix?@abmiller99 commented on GitHub (Oct 14, 2016):
OK:
<path>=/etc/postfix/<driver>=pgsqlRan this:
(env)modoboa@mail:~$ cd instance(env)modoboa@mail:~/instance$ python manage.py generate_postfix_maps --destdir /etc/postfixThen checked postfix main.cf for:
(it was already there)
Then
$ service postfix reloadThen
$ service uwsgi reload@tonioo commented on GitHub (Oct 14, 2016):
The
generate_postfix_mapscommand must be ran as root (because it is writing to /etc/postfix) and you forgot the--force-overwriteoption.About the internal error, you need to upgrade extensions too.
@abmiller99 commented on GitHub (Oct 14, 2016):
OK,
root@mail /srv/modoboa/instance $ python manage.py generate_postfix_maps --destdir /etc/postfix --force-overwriteroot@mail /srv/modoboa/instance :( $ service uwsgi reloadroot@mail /srv/modoboa/instance $ service postfix reloadSure - are there instructions for upgrading the plugins?
@tonioo commented on GitHub (Oct 14, 2016):
Run the
generate_postfix_mapscommand as follows:To upgrade extensions, run (as modoboa and with virtualenv loaded):
And reload uwsgi.
@abmiller99 commented on GitHub (Oct 14, 2016):
OK that all worked 100% - tremendous job guiding me.
@mdcfe commented on GitHub (Oct 14, 2016):
I've been following this as it happened - I encountered very similar problems to this and this just helped me fix them. Thanks @tonioo
@tonioo commented on GitHub (Oct 19, 2016):
The documentation has been refactored and now includes clear upgrade instructions (I hope so).
http://modoboa.readthedocs.io/en/latest/upgrade.html