Setup on my Development Computer

I wanted to develop in Vagrant because it allows me to isolate my build environment.
I learned about Vagrant working with Laravel.

This link provides ability to download a full virtualized development environment for Drupal

There is a Chef program script that does vagrant scripting for Drupal. You must install Chef on your local operating system. Then, there is a vdd environment with Chef files already setup to get you into a Drupal system that should work.

Backup and Restore

Backing up from the command line. This works to create backups to use to recreate your current website. It will cause problems if you intend to restore the backup to another URL. The main problem has to do with the user table. For security reasons the user table contains encrypted passwords. These encryptions are linked to the specific location of development and when migrating to a new location are broken.

I had issues using backup and restore module migrate functionality. Perhaps it relies on applications not available on my hosting system computer.

The following link helps with restoring the passwords once they have been overwritten by doing a migrate with a full SQL created outside of the Backup and Migrate module.

USE the SQL from the BACKUP AND MIGRATE and avoid problems with the SQL import. That backup doesn't include passwords for users.

I use Git as the repository for my website. I also use gitg as a graphical user interface.

I found these to be good references for Git.

I can't use git to update my host website because my host apparently doesn't have git installed. AND I can't install it myself because I don't have access to gcc on my host system to compile the git source code.

This is another one of those things to look at when deciding on a production web hosting service. (I should write an article on that issue at some point.)

Installing drush on shared hosting environment


I have installed drush within my vagrant development environment because that is where my website exists along with most of the tools that support it. Git however is on my top level environment because does not require the tools for my website. I use Git for many of the things I do other than Drupal, so it makes more sense to have it installed on a more global level.

On restoring the application on my hosting site, I lost all my pictures. Not sure how exactly that happened. The database was fine... The actual pictures were not there. Once I copied them to the places then needed to be (from the same place they were on the other working site – directory for images under the theme and for others... sites/default/files/field/image/(files)) it all worked fine.

I learned where to put the uploaded files to the hosting site, that are backups from my local computer's site. I suppose it would make more sense to learn to upload, and then do the restore using drush.

Using drush
drush is inside of my vagrant machine, therefore I need to vagrant ssh into that environment prior to running drush commands.

seeing drupal information (theme, versions, all that sort),

$drush status

clearing all caches

$drush cc all

install a module:

$drush dl (module)
$drush en (module) – note enable will deal with asking about dependencies... etc.

$disable module
$drush dis (module)

Drush has lots of updating ability.

Drush to install a module- note that the module archive isn't saved on the development machine when doing this.

move to directory mysite/all/modules

$drush dl modulename
$drush en modulename

which asks questions about other required modules, thereby making an install a bit easier.

Using the Drupal Test Suite

I decided I needed to figure out the best way to run tests that isolated the various problems I could have with my websites. I thought it would make sense to run all the Drupal tests, in the Drupal test suite on a blank website in my vagrant environment to get a baseline of the results. In that way, I could compare those results against all tests I may run in the future on a production website. I created a testDrupal directory both on my hosting platform, and on my local computer.

I downloaded the Drupal 7.41 system and extracted it to my local vagrant environment in testDrupal

created a database in mysql testDrupal

then started the install process from the browser.

I tried to run the tests. My development computer and my own patience is just not up to the task at this time!

Basics of Drupal Development