Changing DB Name ¿how?

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Changing DB Name ¿how?

by Esteban Gomez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I need to work with two separated instances of Dspace. The first installation was clean and without problems, but the second it isn't, because I need to get a different instance of DB. The mvn package command worked fine, but when I run the ant fresh_install command, gives an error saying that there is no DB named dspace (I'm running it on a test server, that doesn't have any dspace installed). I changed the line that gives acces to postgres url and ports on dspace.cfg (it was like db.url = jdbc:postgresql://localhost:5432/dspace and changed it for db.url = jdbc:postgresql://localhost:5432/newdbname) but it didn't work

Where can I find the correct variable to change the DB name? or it's impossible to do that?

txs

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
DSpace-tech mailing list
DSpace-tech@...
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Re: Changing DB Name ¿how?

by Alvaro Sandoval :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi txs:

We needed the same. After some research and testing, I could work it
out. Here is how (not necessarily the only way):

Context:
We have 1 instance of tomcat. Every new dspace instance is running as a
different webapp, ie, with different names.

1) Create new dspace databases:
$ createdb -U postgres -E UNICODE -O dspace dspace-1
$ createdb -U postgres -E UNICODE -O dspace dspace-2
$ createdb -U postgres -E UNICODE -O dspace dspace-3

2) Create new dspace source directories:
$ mkdir /srv/dspace-1
$ mkdir /srv/dspace-2
$ mkdir /srv/dspace-3

3) Create new dspace config files:
$ cp [dspace-source-dir]/config/dspace.cfg
[dspace-source-dir]/config/dspace-1.cfg
$ cp [dspace-source-dir]/config/dspace.cfg
[dspace-source-dir]/config/dspace-2.cfg
$ cp [dspace-source-dir]/config/dspace.cfg
[dspace-source-dir]/config/dspace-3.cfg

Edit each config file, change the following (using the first instance as
an example):
dspace.dir = /srv/dspace-1
dspace.url = http://your-dspace-url:80/jspui-1
db.url = jdbc:postgresql://localhost:5432/dspace-1

4) Create dspace instances, using ant:
$ ant -Dconfig=[dspace-source-dir]/config/dspace-1.cfg fresh_install
$ ant -Dconfig=[dspace-source-dir]/config/dspace-2.cfg fresh_install
$ ant -Dconfig=[dspace-source-dir]/config/dspace-3.cfg fresh_install

5) Create administrator accounts:
$ /srv/dspace-1/bin/create-administrator
$ /srv/dspace-2/bin/create-administrator
$ /srv/dspace-3/bin/create-administrator

6) Include each dspace instance in Tomcat server.xml
Edit /usr/local/tomcat/conf/server.xml.
Include the following in <host> tag:

<Context path="/jspui-1" docBase="/srv/dspace-1/webapps/jspui/"
debug="0" reloadable="true" cachingAllowed="false" allowLinking="true"/>

<Context path="/jspui-2" docBase="/srv/dspace-2/webapps/jspui/"
debug="0" reloadable="true" cachingAllowed="false" allowLinking="true"/>

<Context path="/jspui-3" docBase="/srv/dspace-3/webapps/jspui/"
debug="0" reloadable="true" cachingAllowed="false" allowLinking="true"/>

Regards,
Alvaro

PS: There is another way: running multiples intances of Tomcat, one for
each dspace instance. This option is too expensive in CPU.
Check this URL for this option: http://www.linuxjournal.com/article/8561


El mar, 19-08-2008 a las 12:05 -0400, Tebota escribió:

> I need to work with two separated instances of Dspace. The first
> installation was clean and without problems, but the second it isn't,
> because I need to get a different instance of DB. The mvn package
> command worked fine, but when I run the ant fresh_install command,
> gives an error saying that there is no DB named dspace (I'm running it
> on a test server, that doesn't have any dspace installed). I changed
> the line that gives acces to postgres url and ports on dspace.cfg (it
> was like db.url = jdbc:postgresql://localhost:5432/dspace and changed
> it for db.url = jdbc:postgresql://localhost:5432/newdbname) but it
> didn't work
>
> Where can I find the correct variable to change the DB name? or it's
> impossible to do that?
>
> txs
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________ DSpace-tech mailing list DSpace-tech@... https://lists.sourceforge.net/lists/listinfo/dspace-tech
--
Álvaro Sandoval
BCN, Biblioteca del Congreso Nacional
Servicios Digitales. Ingeniería y Desarrollo
Fono: (56-32) 226 3981. Fax: (56-32) 226 3973
www.bcn.cl


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
DSpace-tech mailing list
DSpace-tech@...
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Re: Changing DB Name ¿how?

by Mark H. Wood :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Aug 19, 2008 at 12:05:36PM -0400, Tebota wrote:

> I need to work with two separated instances of Dspace. The first
> installation was clean and without problems, but the second it isn't,
> because I need to get a different instance of DB. The mvn package
> command worked fine, but when I run the ant fresh_install command,
> gives an error saying that there is no DB named dspace (I'm running it
> on a test server, that doesn't have any dspace installed). I changed
> the line that gives acces to postgres url and ports on dspace.cfg (it
> was like db.url = jdbc:postgresql://localhost:5432/dspace and changed
> it for db.url = jdbc:postgresql://localhost:5432/newdbname) but it
> didn't work
In what way did it not work?  Precisely.  What messages did you receive?

Did you create a database 'newdbname' in PostgreSQL on the test
server?

Does the Pg user named by db.user exist in Pg on the test server?
Does db.password correctly specify that user's Pg password?  Is that
user permitted access to the database 'newdbname' from IP host
127.0.0.1 or ::1?

You can name the database any way you like, but a database by that
name must be created before 'ant fresh_install' can define the tables
in it.  You can name the database user as you please, but that user
must exist in Pg and must be permitted (in pg_hba) access via IP to the
database you named in the DSpace config.  You can even run the DBMS on
any other machine you wish, but on that machine you must configure Pg
to permit the configured user, using the configured password, access to
the configured database from the host on which that DSpace instance runs.

> Where can I find the correct variable to change the DB name? or it's
> impossible to do that?

db.uri completely specifies the type, location, and name of the
database.  In the first example you give:

o  the type is PostgreSQL;
o  the location is 'localhost' (127.0.0.1 or ::1) and the port is
   5432;
o  the database is named 'dspace'.

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



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
DSpace-tech mailing list
DSpace-tech@...
https://lists.sourceforge.net/lists/listinfo/dspace-tech

attachment0 (204 bytes) Download Attachment