On Wednesday, January 23, 2019 at 7:12:07 PM UTC-5, Khanh M. Mai wrote:
>
> I was connecting to my database through a proxy.  This time I set my 
> dspace install to connect directly to the the postgres instance. 
>
>  
>
> The error now is regarding CREATE TABLE dspaceobject
>
>  
>
> Am I doing my import correctly? Are there any special flags for the 
> pg_dump I need to add?
>   
>
> [root@rworks61 dspace]# bin/dspace database migrate
>
>  
>
> Database URL: jdbc:postgresql://dspacepg1:5432/researchworks56_db
>
> Migrating database to latest version... (Check dspace logs for details)
>
> Migration exception:
>
> java.sql.SQLException: Flyway migration error occurred
>
>         at 
> org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:673)
>
>         at 
> org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:576)
>
>         at 
> org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:221)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
>         at java.lang.reflect.Method.invoke(Method.java:498)
>
>         at 
> org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
>
>         at 
> org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
>
> Caused by: org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException:
>
> Migration V6.0_2015.03.07__DS-2701_Hibernate_migration.sql failed
>
> -----------------------------------------------------------------
>
> SQL State  : 42P07
>
> Error Code : 0
>
> Message    : ERROR: relation "dspaceobject" already exists
>
> Location   : 
> org/dspace/storage/rdbms/sqlmigration/postgres/V6.0_2015.03.07__DS-2701_Hibernate_migration.sql
>  
> (/var/dspace/file:/var/dspace/lib/dspace-api-6.3.jar!/org/dspace/storage/rdbms/sqlmigration/postgres/V6.0_2015.03.07__DS-2701_Hibernate_migration.sql)
>
> Line       : 14
>
> Statement  : CREATE TABLE dspaceobject
>
> (
>
>     uuid            uuid NOT NULL  PRIMARY KEY
>
> )
>


It seems that at least one table was created by the migration that failed 
-- that is, the migration succeeded *in part* but is listed as not yet 
executed.  Before doing anything else, I would dump the database as it is, 
so that you can get back into the current state if something goes wrong.

Then, if you have a dump of the database from before you began the upgrade, 
it might be safest to DROP the DATABASE, restore that dump, and start over.

If you have no pre-upgrade dump, then I would try DROPping the 
'dspaceobject' TABLE and running 'bin/dspace migrate' again.  Since I don't 
know the state of the database, this is dangerous advice -- there may be 
other damage that I don't see.

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to