If I want to re-initialize my installation to make it like it was when I first installed it, can I simply drop the database and re-run the installation?

Here are the steps I followed:
1.) Drop the database
2.) Recreate the database as described in the INSTALL.mysql.txt
If the database name changed, edit
[drupal home]/sites/defualts/settings.php
and change the value for $db_url
3.) set write permissions on sites/defaults
4.) Re-run the installer program:
http://yourdrupalsite.com/install.php
5.) clear write permissions on sites/defaults

Is there anything else I need to do? e.g,. delete anything at the filesystem?

Or would I just be better off removing and then reinstalling the drupal package?

Comments

Anonymous’s picture

If you want to re-initialize (e.g., start over from the beginning):

CAUTION: THIS WILL DESTROY EXISTING DATA.
IF YOUR WEBSERVER OR MYSQL DATABASE ALSO HOST ANY OTHER DRUPAL WEBSITES,
REQUEST HELP FROM A SYSADMIN

Database related tasks

  • Drop the database (e.g., for the database myd6db)
    SQL> drop database myd6db;
  • Recreate the database
    SQL> create database myd6db;
  • Grant permissions
    [see the instructions from INSTALL.mysql.txt ]
  • If the database name changed, update the settings.php
    • If single-site:
      $ chmod u+w sites/defaults/settings.php
      $ vi sites/defaults/settings.php
      change the value for $db_url
      $ chmod u-w sites/defaults/settings.php
    • If multi-site:
      $ chmod u+w sites/yourdrupalsite.com/settings.php
      $ vi sites/yourdrupalsite.com/settings.php
      change the value for $db_url
      $ chmod u-w sites/yourdrupalsite.com/settings.php

Set the filesystem permissions so Install can write

  • If single-site:
    $ sudo chmod o+w sites/default
  • If multi-site:
    $ sudo chmod o+w sites/yourdrupalsite.com

Delete any files that had been uploaded to the old installation

  • If single-site:
    $ sudo rm -R sites/default/files/*
  • If multi-site:
    $ sudo rm -R sites/yourdrupalsite.com/files/*

Then re-run the installer program
http://yourdrupalsite.com/install.php

Then reset the filesystem permissions

  • If single-site:
    $ sudo chmod o-w sites/default
  • If multi-site:
    $ sudo chmod o-w sites/yourdrupalsite.com

The advantage of this procedure is that your modules and themes stay intact, without having to re-install them. Specifically:
sites/all/modules
sites/all/themes
sites/yourdrupalsite.com/themes

These instructions may work for Drupal 5 as well ..., I only worked with Drupal 5 briefly so cannot verify.