Duplicating a Drupal configuration in TKL's Drupal VM.

Bill Carney's picture

My background is on Windows, but I want to learn Drupal on Linux, so I downloaded and played with the TKL Drupal VM.

On the Windows side if I want to duplicate a "template" Drupal configuration I have set up, all I have to do is:
Dump the database to a backup file.
Create new database and restore the template backup to it.
Duplicate my template website (ie D:\Sites\Template to D:\Sites\
Load up IIS and create a new site pointing to to D:\Sites\
Load D:\Sites\\sites\default\settings.php and edit the $db_url line.
Easy peasy.
What is the process to do the same in TKL Drupal VM?
To test things out, I loaded up and configured the default Drupal site with a generic "First Test Site" name.
Then I downloaded the contents of /share/drupal6 to a temp folder my desktop
and /etc/drupal/6/sites to the temp folder my desktop
I created /var/www/ and copied the contents of my temp folder into it
In Webmin, Servers, Apache Web server, I created a new virtual host.  I selected /var/www/ as the document root, as the server name, and Copy directives from changed to Automatic:80 /usr/share/drupal6/
Then in the virtual server I selected and 'Networking and Addresses" and added as an Alternate virtual server name.
I applied the changes, and also Stopped and Started Apache.
Loaded up PHPMyAdmin, Exported the drupal6 database.
Created 'Domain1' database
Imported drupal6 backup into it.
Edited /var/www/ and dbconfig.php to use the root acct/password to access the domain1 database 
I'm able to view the default page on, but after attempting to log in it tries to go to and I get a Not Found error.  If I go to the IP address, the default site bombs out with the same error.  Basically, Drupal stops working.
I suspect it's because I haven't copied some files to a proper location, but I don't know where to start.  Any ideas?
Jeremy Davis's picture

I have no idea really as I have very little experience with Drupal, but on reading your post, my first thought is to make sure file permissions are ok.

By downloading files to Win and then reuploading them, it will strip the Linux file permissions (I assume that you reuploaded as root - therefore the 'new' site will be owned by root and the webserver won't have access to it). So to fix this, change the owner to www-data (the default webserver user). You can do this through the Webmin File Manager if you wish (click on the webroot folder in the right pane, then click Info, change owner and make sure you allow it to propergate to all files and subfolders). Or from the commandline (assuming webroot of /var/www/

chown -Rv www-data:www-data /var/www/

You may also need to tweak the ownership of the db although I'm not too sure about that (or how you go about it if you do).

Post new comment