On 05/05/2011 01:02 PM, John Mazzitelli wrote:
If you have the source code, you can run dbsetup to reset your database. git checkout the source, make sure your maven settings.xml is setup properly (see etc/m2/settinsg.xml in the source for an example) then:
cd modules/core/dbutils mvn -Ddbsetup -Dmaven.test.skip install
This will drop all tables, then recreate them from scratch - you'll lose all inventory and data when you do this - you start as if you just installed the RHQ Server anew. Make sure you stop the RHQ Server before doing this, obviously. After dbsetup finishes (takes a few seconds), restart the RHQ Server.
If you don't want to bother going thru this setup of the build from source, just do an initial install of your RHQ Server (i.e. unzip the distro, run it, go through the UI installer to install the server),
Note, assuming this is a reinstall, make sure to choose "Overwrite existing data" in the installer, rather than "Upgrade existing data". The overwrite option is the equivalent of running the dbsetup utility.
then backup the DB. When you want to restart, just stop the RHQ Server, revert your DB backup, then restart the RHQ Server. I do this alot on Postgres - its really easy to backup and restore on Postgres using their admin tool.