can't upgrade db after upgrade to 1.2.2

24 views
Skip to first unread message

Phil Cummins

unread,
Feb 24, 2015, 3:26:36 AM2/24/15
to openqua...@googlegroups.com
Hi,

I have had openquake version 1.0.0-2+dev1410384188-b6c109e installed on an AWS ubuntu instance which has been running fine for some time. However, I needed a new GMPE, so I upgraded to version 1.2.2-git0f9e954. I have followed the steps in the installation instructions, but when I try to upgrade the db, I get:

%:~/oq-engine$ ./bin/oq-engine --upgrade-db

Traceback (most recent call last):
  File "./bin/oq-engine", line 576, in <module>
    main()
  File "./bin/oq-engine", line 461, in main
    conn, extract_scripts='read_scripts')
  File "/home/ubuntu/oq-engine/openquake/engine/db/upgrade_manager.py", line 380, in what_if_I_upgrade
    % (current_version, script['fname']))
openquake.engine.db.upgrade_manager.VersionTooSmall: Your database is at version 0005 but you want to apply 0004-asset-site-epsilons.sql??

An then when i try to run oq-engine, it complains that the the database needs to be upgraded.
Can anyone please tell me what I should do to upgrade the database? (I am happy to completely delete the old database but don't know how)

Thanks,

- Phil 

Daniele Viganò

unread,
Feb 24, 2015, 3:42:11 AM2/24/15
to openqua...@googlegroups.com
Dear Phil,

On Tuesday, February 24, 2015 at 9:26:36 AM UTC+1, Phil Cummins wrote:
I have had openquake version 1.0.0-2+dev1410384188-b6c109e installed on an AWS ubuntu instance which has been running fine for some time. However, I needed a new GMPE, so I upgraded to version 1.2.2-git0f9e954. I have followed the steps in the installation instructions, but when I try to upgrade the db, I get:
[...]

openquake.engine.db.upgrade_manager.VersionTooSmall: Your database is at version 0005 but you want to apply 0004-asset-site-epsilons.sql??

An then when i try to run oq-engine, it complains that the the database needs to be upgraded.
Can anyone please tell me what I should do to upgrade the database? (I am happy to completely delete the old database but don't know how)

This could happen upgrading from very old nightly builds. The easiest way to fix it is to drop and recreate the database:

$ sudo -u postgres dropdb openquake2
$ sudo -u postgres oq_create_db --db-name=openquake2
$ oq-engine --upgrade-db

Thank you for your feedback. We'll add this issue to our FAQ.

Regards,
Daniele

Phil Cummins

unread,
Feb 24, 2015, 9:26:58 PM2/24/15
to openqua...@googlegroups.com
Hi Daniele,

That worked fine. Many thanks!

- Phil
Reply all
Reply to author
Forward
0 new messages