The db needs to be downloaded every 3 months and every 6 months. While I can successfully login the snapshots page is displaying error 404. I am pretty sure the db download function should be in controller but I would like to know how to proceed with enabling user to download snapshots of the entire database.
I can't comment on why you get a 404, you'll have to debug that.
As to downloading a database snapshots, that is a very ambiguous task. What is the purpose of this download, what will happen with the data after the download? In which format are you going to download it?
I believe the 404 is due to not having the correct controller code in place therefore cannot see the view properly. Once the user logs in, they should be presented with the download button below:
Once clicked, the user should be able to download snapshot of the entire db as a file (in a folder) on the user's local machine (they would like to keep a snapshot of the db record rather than altering the original db). They should be able to take snapshots of data entered quarterly (at 3 months and 6 months). Also, they want to be able to download snapshot of data entered on the day.
However, the user is not quite tech savvy and would like the easiest way to access the snapshots so I am open to suggestions for a simpler solution. Also, since controller is the one handling the request I don' t think I would require a model, would I?
Would it be possible to programme so that the SQL file is created and archived automatically every 3 months, whereas the user-file could be generated by me as needed on my PC?
So a snapshot is a file with SQL commands? Like a PHPMyAdmin export?
If you have cron access to that server, it's probably easier to schedule a nightly "mysqldump", so that file can be downloaded, instead of trying to generate a SQL dump (which will take very long if done in a controller).
The controller problem is for you to solve, it's impossible to comment without acccess to the code (which I don't want ;-)).
Similar to PHPMyAdmin export but using Toad for MySQL instead.
However, since I do not have cron access and as you said the mysqldump will take quite a while, the simplest format I currently came across was downloading the data in each sql table as a html table in a single zip file. This would allow the user to download the zip file containing the html table with the data from the database whenever needed.
Would that be a better alternative? Since the sql query will generate the table, I am going to be writing the query in the controller and allowing the user to download the generated zip file via a download button.