sudo tasksel install lamp-server
The install process will stop at one point to ask for the password of the root user for MySQL. Once the install completes, use the MySQL command-line client to add in the same database (an empty one) and user that Drupal uses.
mysqldumpto dump out the Drupal database data into an sql file. Load it in the new database, populating it. You'll want to tar up the whole directory where the Drupal files reside (not forgetting the .htaccess) and expand it out in the same location within the new machine. You may (not) need to edit
.htaccessfor any host information changes.
settings.phpis also where you edit the database login information, if you decide to use different ones.
With Apache running, you should be able to hit the new Drupal site. It looks to be running but there are a few gotchas. If you are (most likely) running Clean URLs, the links don't work anymore. You'll need to disable it to get navigation working at
http://hostname/?q=admin/settings/clean-urls, maybe going through
http://hostname/?q=userto log in first. To set up Clean URLs again, you need to run this line:
sudo a2enmod rewrite
/etc/apache2/sites-available/default, changing the
AllowOverride Allinside the directory with the path
/var/www, or where the Drupal files live. Restart the server and you find that you can enable Clean URLs now.
The other gotcha is that the status report is complaining it can't find the PHP GD library. Apparently PHP library is installed but not configured so you run these lines:
sudo apt-get install php5(optional?)
sudo apt-get install php5-gd
Lastly, cron needs to be set up to update the Drupal site. I use
curlso the lines are:
sudo apt-get install curl
0 * * * * curl --silent --compressed http://localhost/cron.php
The last line is done inside the
vieditor so after that, save and quit.
Congratulations! Your Drupal site is now running fine on the new machine.