I want to phase out an old, unmaintained Drupal 6 page. The website should still stay online, but should be read-only.

I want to change the database user so that it only has read privileges. I don't want the website to be exploitable due to any security issue in Drupal 6 or any of the modules.

Is it possible to give Drupal 6 a read-only database user? On which table is write access necessary?

  • May be use httrack to get static pages and host it somewhere and redirect to the static site. Apr 9, 2021 at 3:56

3 Answers 3


You can make make read only tables, except: semaphor, watchdog, cache, cache_[ANOTHERS], sessions, and another tables, depend on installed modules, that can modify tables on guests visiting, login or form submissions, like statistics, flag and so on.

But I strongly DO NOT recommend this, because instead of showing read only site you may show white or errors screen.

Better is use Read only mode module, that make site read only (prevent form submissions and so on).

Another solution - make backup, then restore 1 per day via bash script. Samples.


You could have a module like Boost or similar generate a static version of the site and then just serve that and decommission the database - unless you have some dynamic/ajax action happening. You could also dump the site with a tool like HTTrack.


For a site where users cannot login, read-only access to the database is possible if none of the modules:

  • Saves data in the database
  • Stores data in the user session
  • Caches data
  • Uses the locking system implemented by Drupal core
  • Saves or deletes persistent variables
  • Logs errors

If the purpose is just avoiding the Drupal site writes on the database, it's possible to provide a different implementation for session handlers, cache, and lock system that stores data in Memcached, but the data would not persist as in a database. (This could be the desired effect, if the site isn't supposed to store the data for anonymous users for much long.)
The data stored from watchdog() can be stored in the system Syslog, if instead of the Database logging module the site uses the Syslog module. As for storing data in the session, keep in mind that even a call to drupal_set_message() causes Drupal to add data in the session.

Otherwise, for a partial read-only access to the database, the following database tables should be writable.

  • cache
  • cache_*
  • semaphore
  • sessions
  • variable (This is the database table where the values submitted in a form could be saved, especially setting values.)
  • watchdog, if the Database logging module is enabled
  • Any database table the installed modules use to write data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.