Setting up Drupal stage environment from existing site

I setup a new stage environment, installed the basic Drupal Module and MySQL database and had it working. But somehow – any links on the homepage would never redirect. This is what I had to do in order to get the website running (will start from scratch):

1. Install Apache2 and MySQL on the new machine
2. Install Drupal on the machine and configure it to work with MySQL
3. Get an entire –all-database MySQL dump from the current drupal website (Get the dump by logging in as root)

mysqldump -hlocalhost -uroot --all-databases -p > cart-backup.sql

4. Get the tarball of the drupal website files from the current drupal website
5. Take a backup of the drupal files on the new database and replace them with the backup from production
6. Take a full DB Backup of the existing database and restore them with backup from production

mysql -h localhost -uroot -pYour-Db-Password < cart-backup.sql

7. Get the apache site configuration from production and restore on the new website. Note: The path of the document root may vary – so please setup accordingly

Restart apache and mysql services. I got the following error on the console: “Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration”

Researched and found out that mod_rewrite has to be enabled for the website as per the configuration. The module was available under /etc/apache2/mods-available/. A link to this module had to be created under /etc/apache2/mods-enabled/ using the following command:

cd /etc/apache2/mods-enabled/
ln -fs ../mods-available/rewrite.load rewrite.load

Restart apache services and BOOM !!! The webiste is up and running… Yeah !


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s