Hello Francis,

Others have explained what to do if you are using the supplied Derby db. To
my knowledge, there is no built-in support for doing this with dbs other
than Derby.

We use MySQL, so we wrote our own ant task to do this, which I will include
below. I expect it can be easily modified for use with postgresql or other
database systems.

This ant task assumes existence of a file java.local.properties in the
user's home directory. That file should hold local values for the
environment, such as username and password of a db user that has
appropriate permissions. This means each developer can have a different
configuration for their local database.

Cheers,
Anne.


<target name="clean-mysql" description="Drop and recreate dbs">
        <property file="${user.home}/java.local.properties" />
        <property name="db.name" value="ofbiz" />
        <property name="db.driver" value="${local.db.driver}" />
        <property name="db.url" value="${local.db.url}" />
        <property name="db.pwd" value="${local.db.pwd}" />
        <property name="db.user" value="${local.db.user}" />
        <fail message="No mysql driver, not cleaning mysql db">
            <condition>
                <not>
                    <available type="file"
file="mysql-connector-java-5.1.7-bin.jar"
filepath="framework/entity/lib/jdbc/" />
                </not>
            </condition>
        </fail>
        <echo message="Resetting ${db.name}erp, ${db.name}olap and
${db.name}tenant"
/>
        <sql driver="${db.driver}" url="${db.url}" userid="${db.user}"
password="${db.pwd}" expandproperties="true">
            <classpath>
                <fileset dir="framework/entity/lib/jdbc" includes="*.jar" />
            </classpath>
            <![CDATA[
            drop database if exists ${db.name}erp;
            drop database if exists ${db.name}olap;
            drop database if exists ${db.name}tenant;
            create database ${db.name}erp;
            create database ${db.name}olap;
            create database ${db.name}tenant;
            ]]>
        </sql>
    </target>


On 26 March 2012 17:00, Yashwant Dhakad <[email protected]>wrote:

> Hi Francls,
> If you are using Derby Database then use this command:
>
> $ ant clean-all
>
> For loading seed and seed-initial datas use this command:
>
> $ ant run-install-readers -Ddata-readers=seed,seed-**initial
>
> Thanks & Regards
> --
> Yashwant Dhakad
>
>
> On 03/26/2012 11:03 AM, Francis ANDRE wrote:
>
>> Hi
>>
>> I am wondering how to make a full cleanup/erase of all datas in the
>> database in order to reload only seed and seed-initial??? Any idea other
>> than drop the database and reinstall??
>>
>> TIA
>>
>>
>>
>


-- 
Coherent Software Australia Pty Ltd
PO Box 2773
Cheltenham Vic 3192
Phone: (03) 9585 6788
Fax: (03) 9585 1086
Web: http://www.cohsoft.com.au/
Email: [email protected]

Bonsai ERP, the all-inclusive ERP system
http://www.bonsaierp.com.au/

Reply via email to