Changes between Version 24 and Version 25 of Software/Productionalisation/RealDb


Ignore:
Timestamp:
03/21/14 11:23:52 (6 years ago)
Author:
smith@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Software/Productionalisation/RealDb

    v24 v25  
    1818 
    19191. Install and configure a production ready database (either on the same server or a different server). 
    20 2. Configure the Raptor MUA to use the database. 
     201. Configure the Raptor MUA to use the database. 
     211. Setting up the database schema 
     22 
    2123 
    2224== 1. Installing and Configuring a database == 
     
    2527 * For example, postgres on linux using YUM - {{{yum install postgres}}}, or using the Windows installer. For Postgres guides see http://wiki.postgresql.org/wiki/Detailed_installation_guides. 
    26281. Set up the Raptor schema in the database. 
    27  * Create a database named 'mua'. e.g. in Postgres, '{{{create database mua}}}' 
    28  * Use the database schema to create the neccessary tables etc. For Postgres this is defined [Software/Productionalisation/MuaSchema here], which you can [[https://iam.cf.ac.uk/trac/RAPTOR/attachment/wiki/Software/Productionalisation/RealDb/mua-schema.3.sql|download]]. 
     29 * Create a blank database named 'mua'. e.g. in Postgres, '{{{create database mua}}}' 
    29301. Set up users. 
    3031 * Add a user "raptor" with a password of your choosing with admins rights (Alternatively you could choose to use the default Postgres user for ease of setup).  
     
    6970}}} 
    70711. In the bean relevant for your database, change the connection parameters to match those of your database (i.e. jdbcUrl, user, and password). 
     72 
     73== 3.  Setting up the database schema == 
     74 
     75The most reliable way to set up the database schema is to get hibernate to do it for you. To do this, perform the following steps: 
     76 
     771. Edit the file {{{mua/conf/database.xml}}}. 
     781. Find the bean with id of "muaSessionFactor" (should be one of the very first in the file) 
     791. In this, find the property with name "hibernate properties". 
     801. In this, find the prop with the key of "hibernate.hbm2ddl.auto". 
     811. Change the value from "update" to "create". 
     821. Restart the MUA. Hibernate will now create the schema relevant to the dialect you choose in section 2 of this guide. 
     831. **IMPORTANT**: Once the MUA has started, change the value from "create" back to "update" - if you do not do this, next time the MUA is started hibernate will wipe out your database and recreate it from scratch, losing all data in the process!