Search code examples
mysqlruby-on-railsrubymod-rails

Archiving an Entire Rails Site


I have a Ruby on Rails site that was only needed for a short period of time during which users added various objects to a mySQL database, commenting on them, associating themselves with them, etc. etc. etc.

The question is this: the site is no longer needed until a week next year around this time when I will clear the database and use it again (starting from scratch). What's the best way to archive the current site so that the existing content is still viewable but no new content can be added? By best way, I mean the method by which the least system resources will be used, the server will be the safest, etc.

Any suggestions?


Solution

  • If you wrote the app in the standard way, i.e. all the modifications are done via create, update or destroy actions in your controllers, add a before_filter to your ApplicationController that will prohibit accessing those methods (and probably new and edit, too).

    You might also want to check your routes.rb to see if you don't have any other actions that modify your resources and add them to your filter too.