Page 1 of 1

Delete Existing Production Database ?

Posted: Fri May 02, 2014 7:44 am
by LzDay
Last season I attempted to run OpenCampground in parallel with the paper, index cards,etc that this Campground now utilizes. Is there a way to delete the PRODUCTION database from last year so I can use the system as a clean slate this season ?

Re: Delete Existing Production Database ?

Posted: Fri May 02, 2014 8:39 am
by nsche
There is no 'one button' process to do this. What would work best depends on how clean you want to start. If you want to start completely from the beginning without any of the configuration you may have done you can do this:
If installed from an Open Campground CD reconfigure to turn off automatic start on boot
Bring up InstantRails (C:\InstantRails2\InstantRails.exe)
Right click on the bold black I in box in the upper left.
Select Rails Applications->Open Ruby Console Window (the following is entered in the black window that appears)

Code: Select all

      cd OpenCampground{your version}
      set RAILS_ENV=production
      rake db:reset
      exit (when done)

This will reinitialize the database and you can go from there. Of course this means you will loose all those spaces you configured etc. Configuring the spaces is now a lot simpler. Update the system to make sure you have the latest version (currently 1220) and the space configuration carries information forward so if you were defining 10 similar spaces you would only end up entering the names of the spaces after you defined the first one.

Alternatively you can go into the reservation list and in-park list and one by one delete/checkout all of the reservations that may be in the system. You then can go to Archives and select all and delete selected. The campers you entered will remain but the rest should be gone.

The third way is to do a backup. You can then edit the backup file (it is a text file) and delete the data you no longer want. This is risky unless you know a bit about databases and the schema of this database.