[Dspace-tech] different database on the same server

29 views
Skip to first unread message

wang jiahui

unread,
Aug 24, 2015, 5:17:37 PM8/24/15
to dspace-tech
Hi,

I want to setup two dspace instances on the same server. These two instances should use different database,
and this claims that one of the databases should not be called *dspace*. If I want to create a database with
a name rather than *dspace*, which is still used by an instance of dspace, where of the src should I make
a change?

I niticed that there are entries in dspace.cfg about the username and password of the database, but I think
leaving these two without changing will be OK.

Is there anyone else did this before?

Thanks

Wang Jiahui

Mark H. Wood

unread,
Aug 24, 2015, 5:17:39 PM8/24/15
to dspac...@lists.sourceforge.net
In [dspace]/config/dspace.cfg, find the property 'db.url'. That
specifies which database to connect. If you're using PostgreSQL, it
looks something like this:

db.url = jdbc:postgresql://localhost:5432/dspace

Replace "dspace" with the name of the database you want to use.
Likewise, if you wanted to put your database(s) on a different host,
you would replace "localhost" with the name or address of that host,
and if you for some reason wanted to run PostgreSQL on a different
port you'd replace "5432".

You can indeed use the same username and password for all of your
DSpace databases, so long as that database user is authorized for
appropriate access to each of them. Whether you *should* is another
question, one which only you can answer. I create separate
credentials for every production DSpace instance.

I have one production box with three DSpace instances, and a
development-environmnent box with, oh, probably a dozen by now. I was
hesitant at first, but it works well.

--
Mark H. Wood, Lead System Programmer mw...@IUPUI.Edu
Typically when a software vendor says that a product is "intuitive" he
means the exact opposite.

wang jiahui

unread,
Aug 24, 2015, 5:17:41 PM8/24/15
to dspac...@lists.sourceforge.net
When I changed the entry and run the fresh_install task, I got this exception:

     [java] 2007-09-12 21:56:24,493 FATAL org.dspace.administer.RegistryLoader @
 anonymous::error_loading_registries:
     [java] org.postgresql.util.PSQLException: ERROR: duplicate key violates uni
que constraint "bitstreamformatregistry_short_description_key"
     [java]     at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse
(QueryExecutorImpl.java:1512)
     [java]     at org.postgresql.core.v3.QueryExecutorImpl.processResults(Query
ExecutorImpl.java:1297)
     [java]     at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecuto
rImpl.java:188)
     [java]     at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJ
dbc2Statement.java:437)
     [java]     at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(
AbstractJdbc2Statement.java :353)
     [java]     at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(Abs
tractJdbc2Statement.java:307)
     [java]     at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUp
date(DelegatingPreparedStatement.java :101)
     [java]     at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUp
date(DelegatingPreparedStatement.java:101)
     [java]     at org.dspace.storage.rdbms.DatabaseManager.execute(DatabaseMana
ger.java:1492)
     [java]     at org.dspace.storage.rdbms.DatabaseManager.update(DatabaseManag
er.java:853)
     [java]     at org.dspace.content.BitstreamFormat.update(BitstreamFormat.jav
a:588)
     [java]     at org.dspace.administer.RegistryLoader.loadFormat(RegistryLoade
r.java:214)
     [java]     at org.dspace.administer.RegistryLoader.loadBitstreamFormats(Reg
istryLoader.java:169)
     [java]     at org.dspace.administer.RegistryLoader.main (RegistryLoader.java
:107)

BUILD FAILED

Is there any more places I need to make a change?

2007/9/12, Mark H. Wood <mw...@iupui.edu >:
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
DSpace-tech mailing list
DSpac...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech





--
王嘉惠

Desmond Elliott

unread,
Aug 24, 2015, 5:17:41 PM8/24/15
to dspac...@lists.sourceforge.net
Could you attach your dspace.cfg please?
> 2007/9/12, Mark H. Wood <mw...@iupui.edu <mailto:mw...@iupui.edu>>:
>
> In [dspace]/config/dspace.cfg, find the property 'db.url'. That
> specifies which database to connect. If you're using PostgreSQL, it
> looks something like this:
>
> db.url = jdbc:postgresql://localhost:5432/dspace
>
> Replace "dspace" with the name of the database you want to use.
> Likewise, if you wanted to put your database(s) on a different host,
> you would replace "localhost" with the name or address of that host,
> and if you for some reason wanted to run PostgreSQL on a different
> port you'd replace "5432".
>
> You can indeed use the same username and password for all of your
> DSpace databases, so long as that database user is authorized for
> appropriate access to each of them. Whether you *should* is another
> question, one which only you can answer. I create separate
> credentials for every production DSpace instance.
>
> I have one production box with three DSpace instances, and a
> development-environmnent box with, oh, probably a dozen by now. I was
> hesitant at first, but it works well.
>
> --
> Mark H. Wood, Lead System Programmer mw...@IUPUI.Edu
> <mailto:mw...@IUPUI.Edu>
> Typically when a software vendor says that a product is
> "intuitive" he
> means the exact opposite.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> DSpace-tech mailing list
> DSpac...@lists.sourceforge.net
> <mailto:DSpac...@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
>
>
>
>
> --
> 脥玫录脦禄脻
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------

Christian Voelker

unread,
Aug 24, 2015, 5:17:43 PM8/24/15
to wang jiahui, dspac...@lists.sourceforge.net
Hello,

Am 12.09.2007 um 16:03 schrieb wang jiahui:

> When I changed the entry and run the fresh_install task, I got this
> exception:
>
> [java] 2007-09-12 21:56:24,493 FATAL
> org.dspace.administer.RegistryLoader @
> anonymous::error_loading_registries:

I remember that I had this error once as well.
I cant remember what the problem was but it was
probably something too stupid to write down
because I dont have it in my records. I guess
I just removed the db, created again and ran
fresh_install again, but thats not sure.

Now for what I actually wanted to tell: There
is a quite elaborate page in the wiki with a
subject like "Installing a test and a live
instance on the same server" or such, which
describes several ways to do so with various
degrees of separation (for one developer or
several developers and so on), but which
basically all rely on the same procedure that
you try to use. I guess you will find more
valuable details there.

Bye, Christian


James Rutherford

unread,
Aug 24, 2015, 5:17:45 PM8/24/15
to Christian Voelker, dspac...@lists.sourceforge.net
The problem is that the fresh_install is loading the wrong (old)
dspace.cfg so it's trying to connect to the existing database, so it's
having problems with duplicate values. Pass the correct path to the new
config by calling ant -Dconfig=/path/to/new/dspace.cfg fresh_install.

Jim
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> DSpace-tech mailing list
> DSpac...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

--
James Rutherford | Hewlett-Packard Limited registered Office:
Research Engineer | Cain Road,
HP Labs | Bracknell,
Bristol, UK | Berks
+44 117 312 7066 | RG12 1HN.
james.ru...@hp.com | Registered No: 690597 England

The contents of this message and any attachments to it are confidential and
may be legally privileged. If you have received this message in error, you
should delete it from your system immediately and advise the sender. To any
recipient of this message within HP, unless otherwise stated you should
consider this message and attachments as "HP CONFIDENTIAL".

wang jiahui

unread,
Aug 24, 2015, 5:17:46 PM8/24/15
to James Rutherford, dspac...@lists.sourceforge.net
The dspace.cfg file is ought to be right since that the destination dir name
is exactly what I set in the file.

And sorry for the duplicate message.

2007/9/12, James Rutherford < james.ru...@hp.com>:



--
王嘉惠

wang jiahui

unread,
Aug 24, 2015, 5:17:46 PM8/24/15
to Desmond Elliott, dspac...@lists.sourceforge.net
I attached my dspace.cfg file.

Here I want to create a database named *vom*, leaving the usename
and password as *dspace*.

Thanks

2007/9/12, Desmond Elliott < desmond...@hp.com>:



--
王嘉惠
dspace.cfg

James Rutherford

unread,
Aug 24, 2015, 5:17:47 PM8/24/15
to wang jiahui, DSpace Tech
On Wed, Sep 12, 2007 at 10:45:19PM +0800, wang jiahui wrote:
> The dspace.cfg file is ought to be right since that the destination dir name
> is exactly what I set in the file.

I can guarantee that one of three thigns are happening:

1. the database already exists with content in it (maybe from a previous
install that you forgot about)
2. ant is using the incorrect dspace.cfg
3. the db.url specified in your dspace.cfg is incorrect

Remember, if your new db is called dspace-foo, your dspace.cfg should
have something like this:

db.url = jdbc:postgresql://localhost:5432/dspace-foo

cheers,

Jim

James Rutherford

unread,
Aug 24, 2015, 5:17:48 PM8/24/15
to wang jiahui, dspac...@lists.sourceforge.net
On Wed, Sep 12, 2007 at 10:47:54PM +0800, wang jiahui wrote:
> Here I want to create a database named *vom*, leaving the usename
> and password as *dspace*.

Your db.url is incorrect. It is trying to connect to the database called
'dspace', you need to change that to be 'vom'.

Claudia Jürgen

unread,
Aug 24, 2015, 5:17:49 PM8/24/15
to wang jiahui, dspac...@lists.sourceforge.net

Hi Wang,

in the config file you attached the name of the db in the db.url is wrong.
Supposing you created a database called vom owned by the user dspace the
line

db.url = jdbc:postgresql://localhost:5432/dspace
should be
db.url = jdbc:postgresql://localhost:5432/vom


Furthermore in the dspace.cfg you provided you must fill in
dspace.url
dspace.hostname
mail.server
and the mail addresses
with the correct values for your installation

hope that helps

Claudia

wang jiahui schrieb:
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

wang jiahui

unread,
Aug 24, 2015, 5:17:52 PM8/24/15
to Claudia Jürgen, dspac...@lists.sourceforge.net
Thank you all, and sorry for this stupid mistake.

2007/9/12, Claudia Jürgen <Claudia...@ub.uni-dortmund.de>:



--
王嘉惠
Reply all
Reply to author
Forward
0 new messages