check database schema in postgres

79 views
Skip to first unread message

Dale Poulter

unread,
Jun 23, 2016, 6:54:54 PM6/23/16
to DSpace Technical Support
We recently upgraded to 5.5 and have discovered a few issues with the upgrade (the registry scripts did not get triggered by tomcat) .  We have resolved the issues up to this point but is there a script available to check the schema to assure nothing else is missing?  Thanks.

-Dale Poulter

Tim Donohue

unread,
Jun 24, 2016, 5:07:50 PM6/24/16
to Dale Poulter, DSpace Technical Support
Hi Dale,

To validate the database, you can simply run:

[dspace]/bin/dspace database info

You should see the basic database information, along with a table of all
the upgrades performed on the database. As long as the upgrades all say
either "PreInit" (which means this script was skipped as it looked to
have been run manually) or "Success" (which means it succeeded during
your upgrade), then you should be OK.

If you see any other messages (like a Failure) then you'll want to rerun
the DB upgrade ([dspace]/bin/dspace database migrate) and look for any
reported errors in your logs.

- Tim
> --
> 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...@googlegroups.com
> <mailto:dspace-tech...@googlegroups.com>.
> To post to this group, send email to dspac...@googlegroups.com
> <mailto:dspac...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.

--
Tim Donohue
Technical Lead for DSpace & DSpaceDirect
DuraSpace.org | DSpace.org | DSpaceDirect.org

Poulter, Dale

unread,
Jun 24, 2016, 5:12:03 PM6/24/16
to Tim Donohue, DSpace Technical Support
Thanks. Sadly, the database info return success and preinit for everything but the database was missing many of the new changes for the metadatavalues for eperson.


-Dale

Tim Donohue

unread,
Jun 24, 2016, 5:31:10 PM6/24/16
to Poulter, Dale, DSpace Technical Support
Hi Dale,

It sounds like (as you noted in your first message) the metadata
registries failed to update automatically. The "database info" script
only checks the database *structure*, and not the contents in the
tables. So, in the case of the registry contents, you can always
manually re-run the registry script to ensure they are updated (it won't
hurt anything). It *should* be triggered automatically during your
upgrade, but it sounds like it may not have occurred properly for you
(and I'm not sure why that would be offhand).

Here's how to re-run the registry updates (manually). Again, in most
scenarios (at least that I've seen), these should be triggered
automatically immediately *after* the database structure/scheme is
upgraded. But, if they didn't trigger, they can be run manually with no
harm to your existing registries:

bin/dspace registry-loader -metadata config/registries/dcterms-types.xml
bin/dspace registry-loader -metadata config/registries/eperson-types.xml
bin/dspace registry-loader -metadata config/registries/sword-metadata.xml
bin/dspace registry-loader -metadata config/registries/workflow-types.xml

I hope that helps. If you are able to figure out why these were *not*
triggered to run automatically (maybe there was an error reported in
your logs during your upgrade?), that'd be useful information to pass
along to us. The intention is to ensure they do run automatically, in
order to make the upgrade process easier.

- Tim
Reply all
Reply to author
Forward
0 new messages