Woman looking stressed out

Creating a “Dev” Copy or Development Version of a Drupal Site on Pair.com Servers

So you have a live Drupal site on a Pair.com server, and you want to test new modules or custom adjustments to the templates or even just security updates.  Well you don’t want to break things on your live site, or your stakeholders will die of shock when their favorite block suddenly disappears. The best thing to do is create a copy or “Dev” version of the site to test new ideas or updates first.  I suggest having a dev version of every live site you maintain.

In order to do this you will need a directory folder for each live site and its respective dev/sandbox in your public.html directory.  You should have a folder named “mysite.com” and another called “dev.mysites.com”.

If you did your original Drupal installation directly in the public.html, create a new directory in public.html titled with the name of your site and copy all the files from your Drupal installation into this folder.  Then remap your URL to this folder through “Domain Management”.  After you have confirmed that your domain is mapping to the new directory folder, delete all the old unnecessary drupal files from the public.html directory.

You will need to create a subdomain to point to the dev site.  dev.mysite.com (replace “mysite”) will work fine and can be set up in your Pair.com control panel under “Domain Management > Add a Domain > Add a SubDomain of a Domain Already on Your Account”  I would suggest selecting “Dedicated IP Domain Hosting”.  That way it is independent from any of your other domains.

This will automatically create a folder called “dev.mysite.com” in your public.html directory.

Then create a new database through the Pair.com control panel.  Select “Manage Your Databases”  make note of any database names already in use.

  • Click on “Create New Database”
  • Name your database.  Use something memorable that will distinguish it from other databases .
  • Access level “Local Only”
  • Optomization Period “Monthly”
  • Click “Add Database”
  • Make careful note of the page of results that come up (Write them down or print them out).  Keep the database name, database server, full-access username and password notated somewhere safe.  You will need this information to complete the installation.

Now you will need to migrate the database from your live site.  You can find the instructions for migrating a Drupal database that I have written here…

Next, through your FTP client, copy all the files from your live Drupal installation to your local machine (This will take a while).  Once that is completed, upload those files from your local machine to the “dev.mysite.com” folder.

Since this is a copy of the live site you will need to edit your “settings.php” (sites>default>settings.php) file to reflect the proper database, password and username for the dev site.  You should find the lines of code to edit around line 185. Correct the information where it says ‘database’=>, ‘username’ =>, ‘password’ =>, and ‘host’ =>.  All this information you should have kept on file from when you created the database.

Since this is a “dev” version of the site, you will want to password protect the directory so that search engines will not index the content and penalize your live site.

  • Go back to your Pair.com control panel.
  • Click on “File Management”.
  • Click on the folder icon for “public.html”.
  • Click on the folder icon for the folder you want to protect.
  • Click on “Web Settings” button.
  • Click on “Access Controls”.
  • Click on “Enable Password Protection”
  • Enter a username and password and click “Add/Edit User”.

Now you have a password protected development version or sandbox of your live site to test new features and upgrades on before pushing them out to your live site.

Zeen is a next generation WordPress theme. It’s powerful, beautifully designed and comes with everything you need to engage your visitors and increase conversions.