Forum Problems Installing LAMS: Re: PROBLEM Integ Moodle & LAMS


 
Search: 

4: Re: PROBLEM Integ Moodle & LAMS
In response to 1 01/03/06 06:03 PM
[ Reply | Forward ]
I'll assume from your other thread that you're running on Windows.

To install LAMS onto an existing database (uninstall existing LAMS first):
1. http://www.lamsinternational.com/documentation/LAMS%201.0.2%20Windows%20Installer%20Manual_attachments/07-mysql%20integration.jpg
2. Simply make sure the details in that screenshot match those of your existing MySQL database.  You'll need the MySQL installation directory, and the root password
3. You can make 'MySQL LAMS User' and 'MySQL LAMS User Password' whatever you want - these are the credentials that LAMS itself will use to access the database.  Same for 'MySQL LAMS Database'.

To transplant your LAMS database onto another MySQL server:
0. You will need to know 3 things - LAMS' database name, LAMS' MySQL user name, and LAMS' MySQL password.  You can get these from C:\lams\lams-config.bat, or your build.properties.
1. Make sure you are running the instance of MySQL that holds LAMS' database.
2. Export your LAMS database using this command:
mysqldump -c -a --add-drop-table -B <lams db name> -r C:\lams-database.sql -u <lams db user name> -p
Then enter the password for the lams db user when prompted.  The database will be dumped in the file called 'lams-database.sql'.
3. Stop MySQL and start the instance of MySQL you want LAMS to use from now on.
4. Import the LAMS database using this command (you will need the MySQL root password of the MySQL you are importing into):
mysql -u root -p < C:\lams-database.sql
5. Open C:\lams\jboss\server\default\deploy\mysql-service.xml in Wordpad and scroll down to this section:

<attribute name="ManagedConnectionFactoryProperties">
          <properties>
            <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost/YOUR_LAMS_DATABASE_NAME_HERE</config-property>
            <config-property name="DriverClass" type="java.lang.String">com.mysql.jdbc.Driver</config-property>
            <!--set these only if you want only default logins, not through JAAS -->
            <config-property name="UserName" type="java.lang.String">root</config-property>
            <config-property name="Password" type="java.lang.String">YOUR_MYSQL_ROOT_PASSWORD_HERE</config-property>
          </properties>

6. Edit the text 'YOUR_LAMS_DATABASE_HERE' and 'YOUR_MYSQL_ROOT_PASSWORD_HERE' with your details.
7. Make sure your currently running MySQL is set to start automatically rather than the one you have just ditched.
Note. It's not good practice to have your LAMS database use your root user's credentials, but it makes these steps a little bit shorter.  You can use the ant command 'ant prepare-db' to create a custom MySQL user for LAMS, provided you have the essential details in C:\lams\lams-package\ant\build.properties

Ugh.  The second way is a bit convoluted, but it should help anyone who wants to transplant their LAMS database to another MySQL instance.

Posted by Jun-Dir Liew

Reply to first post on this page
Back to Problems Installing LAMS