[Dspace-tech] Upgrading dspace database, getting constraint errors

146 views
Skip to first unread message

Anton Angelo

unread,
Aug 26, 2015, 3:44:27 PM8/26/15
to dspace-tech (dspace-tech@lists.sourceforge.net)

Kia ora,

 

I am migrating a database from dspace 1.8 to 5.3, and it is failing at the last step.  Any clues would be gratefully received.  I have tried to run this using flyway (just booting it after I have migrating the database from the old server) and following the step by step instructions at

 

https://wiki.duraspace.org/display/DSDOC5x/Upgrading+DSpace

 

And it has the same outcome.

 

 

System:

psql (PostgreSQL) 8.4.20

redhat 2.6.32-573.1.1.el6.x86_64

 

 

dbase database_info tells me this:

 

Database URL: jdbc:postgresql://localhost:5432/dspace

Database Schema: public

Database Software: PostgreSQL version 8.4.20

Database Driver: PostgreSQL Native Driver version PostgreSQL 9.1 JDBC4 (build 901)

 

+----------------+----------------------------+---------------------+---------+

| Version        | Description                | Installed on        | State   |

+----------------+----------------------------+---------------------+---------+

| 1.1            | Initial DSpace 1.1 databas |                     | PreInit |

| 1.2            | Upgrade to DSpace 1.2 sche |                     | PreInit |

| 1.3            | Upgrade to DSpace 1.3 sche |                     | PreInit |

| 1.3.9          | Drop constraint for DSpace |                     | PreInit |

| 1.4            | Upgrade to DSpace 1.4 sche |                     | PreInit |

| 1.5            | Upgrade to DSpace 1.5 sche |                     | PreInit |

| 1.5.9          | Drop constraint for DSpace |                     | PreInit |

| 1.6            | Initializing from DSpace 1 | 2015-08-19 09:03:33 | Success |

| 1.7            | Upgrade to DSpace 1.7 sche | 2015-08-19 09:03:33 | Success |

| 1.8            | Upgrade to DSpace 1.8 sche | 2015-08-19 09:03:33 | Success |

| 3.0            | Upgrade to DSpace 3.x sche | 2015-08-19 09:03:34 | Success |

| 4.0            | Upgrade to DSpace 4.x sche | 2015-08-19 09:03:35 | Success |

| 5.0.2014.08.08 | DS-1945 Helpdesk Request a | 2015-08-19 09:03:35 | Success |

| 5.0.2014.09.25 | DS 1582 Metadata For All O | 2015-08-19 09:03:35 | Success |

| 5.0.2014.09.26 | DS-1582 Metadata For All O |                     | Pending |

 

But I am getting the following error in the dspace log:

2015-08-19 09:52:04,169 ERROR org.dspace.storage.rdbms.DatabaseManager @ SQL getDataSource Error -

java.sql.SQLException: Flyway migration error occurred

      at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:430)

      at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:338)

      at org.dspace.storage.rdbms.DatabaseManager.initialize(DatabaseManager.java:1373)

      at org.dspace.storage.rdbms.DatabaseManager.getDataSource(DatabaseManager.java:650)

      at org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:629)

      at org.dspace.core.Context.init(Context.java:121)

      at org.dspace.core.Context.<init>(Context.java:95)

      at org.dspace.app.util.AbstractDSpaceWebapp.register(AbstractDSpaceWebapp.java:79)

      at org.dspace.app.util.DSpaceContextListener.contextInitialized(DSpaceContextListener.java:128)

      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)

      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)

      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)

      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)

      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

      at java.util.concurrent.FutureTask.run(FutureTask.java:262)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

      at java.lang.Thread.run(Thread.java:745)

Caused by: org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: Error executing statement at line 84: alter table community drop column introductory_text, drop column short_description, drop column side_bar_text, drop column copyright_text, drop column name

      at org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:91)

      at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:73)

      at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:287)

      at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:285)

      at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)

      at org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:285)

      at org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46)

      at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207)

      at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156)

      at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)

      at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156)

      at org.flywaydb.core.Flyway$1.execute(Flyway.java:864)

      at org.flywaydb.core.Flyway$1.execute(Flyway.java:811)

      at org.flywaydb.core.Flyway.execute(Flyway.java:1171)

      at org.flywaydb.core.Flyway.migrate(Flyway.java:811)

      at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:419)

      ... 21 more

Caused by: org.postgresql.util.PSQLException: ERROR: cannot drop table community column short_description because other objects depend on it

  Detail: view v_stats_workflow depends on table community column short_description

  Hint: Use DROP ... CASCADE to drop the dependent objects too.

      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)

      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)

      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)

      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)

      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)

      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)

      at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

      at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

      at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

      at org.flywaydb.core.internal.dbsupport.JdbcTemplate.executeStatement(JdbcTemplate.java:235)

      at org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:89)

      ... 36 more

 

 

 

With best wishes | Ngā mihi nui

Anton

 

Anton Angelo

Research Data Co-ordinator

University of Canterbury, Christchurch, New Zealand.

 

James Hight Building, 519, Level 5

Ph +64 3 364 2987 extn 8718

 

 

This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.

Anton Angelo

unread,
Aug 26, 2015, 3:44:28 PM8/26/15
to dspace-tech (dspace-tech@lists.sourceforge.net)

Hello all,

 

I have found the problem, and it is a result of some local development we had done.  I should have searched my own email for the fix, as we have seen it before!

 

Nā,

 

Anton.

Shaun donovan

unread,
Aug 26, 2015, 3:44:29 PM8/26/15
to Anton Angelo, dspace-tech (dspace-tech@lists.sourceforge.net)
Hi Anton.

I also noticed that you are using Postgres version 8.4. The documentation states that version 9 is a requirement. You can install version 9 on RHEL using:

yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
yum install postgresql94-server postgresql94 perl-DBD-Pg

You first need to back up your database and yum remove postgresql.
------------------------------------------------------------------------------


_______________________________________________
DSpace-tech mailing list
DSpac...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Message has been deleted
Message has been deleted

vinod mishra

unread,
Mar 4, 2016, 2:09:05 AM3/4/16
to DSpace Technical Support, dspac...@lists.sourceforge.net
Hi,

I have updated once DSpace 1.2.1 to 4.2 every thing worked fine except xmlui interface did not worked, now i have update 4.2 to 5.4 but even though i am facing the same problem however jspui interface worked fine.Please suggest how to make dspace xmlui to work fine?
Reply all
Reply to author
Forward
0 new messages