Need help upgrading from Indico 0.99

Hi,
The migration of indico DB from 0.99 to 1.2 seems to be successful.
It took 15 minutes. I will prepare new indico 2.0 server and migrate the DB.

1 Like

Hi,
Migration from indico 0.99 to indico 2.0 seems to be successful.
Thank you very much for your help.

1 Like

Hi,
We noticed one problem in the migration from indigo 0.99 to 2.0.

In Indico 2.0, the following URL request of indigo 0.99 style
https://hostname/conferenceDisplay.py?confId=1805
is redirected to
https://hostname/event/1805/
This is OK.

However, our top page of the indigo 0.99 was
https://hostname/indico/

So, in Indico 2.0 (+apache), the requested URL of
https://hostname/indico/conferenceDisplay.py?confId=1805
is not redirected to
https://hostname/event/1805/.
and results
Not Found (The page you are looking for doesn’t exist.)

In Indico 2.0 (+apache), is there any apache configuration to redirect the request
https://hostname/indico/conferenceDisplay.py?confId=1805
to
https://hostname/event/1805/
(ignore the first “indico/” string in the requested URL)

Than you for any advice.

The following trwo rewriterules should work (assuming the host changed as well),

RewriteRule event/(.*)$ https://<hostname>/event/$1 [R=permanent,L]
RewriteRule indico/(.*)$ https://<hostname>/$1 [R=permanent,L]

With the host unchanged:

RewriteRule indico/(.*)$ /$1 [R=permanent,L]

should do the trick.

Thank you very much. This works for us.

Hi,
After updating indico from 2.0 to 2.0.1, can I do the process

indico-migrate postgresql:///indico file:///opt/indico-legacy/db/Data.fs …

again from new /db/Data.fs of Indico 1.2.2 on indico 2.0.1
after cleaning the postgresql database of indico 2.0.1 ?

If you already have 2.0 running, you do not need to migrate again - you can simply follow the upgrade instructions to update 2.0 to 2.0.1 (same for any future updates).

If you do want to migrate your ZODB again for some reason, then yes, deleting the postgres database, recreating it with the extensios, and running indico-migrate again would work.

Thanks. Since our indico 0.99 is still running, we will decide the day of the migration
(from 0.99 to 2.0) and migrate again from ZODB.

Hi,
After the (test) migration from indico 0.99 to 2.0, I noticed that all of the registration page (registration form) in indico 2.0 are empty, even if the registration is in open status.

Therefore, I created a test conference page, and created a test Registration Form and then tried to configure the Registration Form. However, there is no items in the Configure questions in form “test of registration” page as attached.
Where is it wrong? Thank you for any suggestion.


We have noticed problems like this one before and as far as I remember the problem was in the Apache
config, namely the RewriteRules. Could you please share the relevant part of your Apache config?

This is usually caused by Indico being accessed by a URL that does not match BASE_URL in indico.conf - that results in the AJAX requests loading the templates for the registration form to fail due to Same-Origin-Policy violations (you can probably see messages about that in your browser’s developer console).

The solution for this is to use the correct url in indico.conf and then reload/restart uwsgi so the updated config is actually used.

Thanks.
Concerning to the apache configuration, I almost exactly follows the page:
https://docs.getindico.io/en/stable/installation/production/centos/apache/#centos-apache-web

In /opt/indico/etc/indico.conf

BASE_URL = 'https://indico3.riken.jp'

and the requested url was

https://indico3.riken.jp/event/2728/registrations/86/

By the way, when I click “configure” the Registration Form, apache logs say,
(404 176)

/opt/indico/log/apache/access.log
134.160.x.x - - [23/Feb/2018:17:14:37 +0900] "GET /event/2728/manage/registration/86/form/ HTTP/1.1" 200 49606 "https://indico3.riken.jp/event/2728/manage/registration/86/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Firefox/52.0"
134.160.x.x - - [23/Feb/2018:17:14:37 +0900] "GET /assets/js-vars/user.js HTTP/1.1" 200 90 "https://indico3.riken.jp/event/2728/manage/registration/86/form/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Firefox/52.0"
134.160.x.x - - [23/Feb/2018:17:14:38 +0900] "GET /modules/registration/form/tpls/registrationform.tpl.html HTTP/1.1" 404 176 "https://indico3.riken.jp/event/2728/manage/registration/86/form/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Firefox/52.0"

/opt/indico/log/apache/error.log
(no new entry)

I temporary opened 443/tcp port of this test server to any.

There is something wrong with redirects in your webserver.

The URL Indico tries to load (which is correct) is https://indico3.riken.jp/js/indico/modules/registration/form/tpls/registrationform.tpl.html - but Apache sends a 301 redirect to https://indico3.riken.jp/modules/registration/form/tpls/registrationform.tpl.html which is wrong.

I think you added a redirect to move from /indico/... to /... but might have forgotten to anchor the regex used there to match only at the beginning of the URL (i.e. you need ^/indico instead of /indico).

I just saw the rewrite rules earlier in this thread, and this is indeed the case.

RewriteRule indico/(.*)$ /$1 [R=permanent,L]

should probably be

RewriteRule ^/indico/(.*)$ /$1 [R=permanent,L]

Note that you might need have to clear your browser cache since 301 redirects are usually cached (but maybe browsers are smart enough to not do that if the redirect points to a 404).

(Two apache httpd files)

[indico3 conf.d] pwd
/etc/httpd/conf.d
[indico3 conf.d]  cat indico-sslredir.conf
<VirtualHost *:80>
    ServerName indico3.riken.jp
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
[indico3 conf.d] 


[indico3 conf.d] cat indico.conf
<VirtualHost *:443>
    ServerName indico3.riken.jp
    DocumentRoot "/var/empty/apache"

    SSLEngine               on
    SSLCertificateFile      /etc/ssl/indico3-20180221/indico3.riken.jp.cer
    SSLCertificateChainFile /etc/ssl/indico3-20180221/nii-odca3sha2.cer
    SSLCertificateKeyFile   /etc/ssl/indico3-20180221/indico3-key.pem

   SSLProtocol             all -SSLv2 -SSLv3

#    SSLCipherSuite          ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
#

    SSLHonorCipherOrder     on

    XSendFile on
    XSendFilePath /opt/indico
    CustomLog /opt/indico/log/apache/access.log combined
    ErrorLog /opt/indico/log/apache/error.log
    LogLevel error
    ServerSignature Off

    AliasMatch "^/static/assets/(core|(?:plugin|theme)-[^/]+)/(.*)$" "/opt/indico/assets/$1/$2"
    AliasMatch "^/(css|images|js|static(?!/plugins|/assets|/themes|/custom))(/.*)$" "/opt/indico/web/htdocs/$1$2"
    Alias /robots.txt /opt/indico/web/htdocs/robots.txt

    SetEnv UWSGI_SCHEME https
    ProxyPass / uwsgi://127.0.0.1:8008/

# https://talk.getindico.io/t/need-help-upgrading-from-indico-0-99/180/12
# should do the trick.
#
    RewriteEngine On
    RewriteRule indico/(.*)$ /$1 [R=permanent,L]
#

    <Directory /opt/indico>
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>
[indico3 conf.d] 

[indico3 etc] cat /opt/indico/etc/indico.conf

# General settings
SQLALCHEMY_DATABASE_URI = 'postgresql:///indico'
SECRET_KEY = '******'
BASE_URL = 'https://indico3.riken.jp'
CELERY_BROKER = 'redis://127.0.0.1:6379/0'
REDIS_CACHE_URL = 'redis://127.0.0.1:6379/1'
CACHE_BACKEND = 'redis'
DEFAULT_TIMEZONE = 'Asia/Tokyo'
DEFAULT_LOCALE = 'en_GB'
ENABLE_ROOMBOOKING = False
CACHE_DIR = '/opt/indico/cache'
TEMP_DIR = '/opt/indico/tmp'
LOG_DIR = '/opt/indico/log'
ASSETS_DIR = '/opt/indico/assets'
STORAGE_BACKENDS = {'default': 'fs:/opt/indico/archive', 'legacy': 'fs-readonly:/opt/indico/legacy-archive'}
ATTACHMENT_STORAGE = 'default'
ROUTE_OLD_URLS = True
XELATEX_PATH = '/opt/texlive/bin/x86_64-linux/xelatex'

# Email settings
SMTP_SERVER = ('127.0.0.1', 25)
SMTP_USE_TLS = False
SMTP_LOGIN = ''
SMTP_PASSWORD = ''
SUPPORT_EMAIL = 'indico@xxx.riken.jp'
PUBLIC_SUPPORT_EMAIL = 'indico@xxx.riken.jp'
NO_REPLY_EMAIL = 'noreply@xxx.riken.jp'

STATIC_FILE_METHOD = 'xsendfile'
[ndico3 etc] 

Thanks.
Replacing the statement

RewriteRule indico/(.*)$ /$1 [R=permanent,L]

with

RewriteRule ^/indico/(.*)$ /$1 [R=permanent,L]

solved this problem !

Please change the SECRET_KEY in your indico.conf as soon as possible! Anyone with that key can generate e.g. email validation links used to reset passwords (and thus take over e.g. your admin account)!

You can generate a new one to copy&paste there by running this command in your terminal:

python -c 'import os; print repr(os.urandom(32))'

Thank you again. I did it.

3 posts were split to a new topic: How to add new currencies?

Finally our indico production server https://indico2.riken.jp/
was updated from indico 0.99 to 2.0.1 today.
Thank you for your support.
Takashi Ichihara

1 Like

Happy to hear that! :wink: