Drupal site deployment - deploy drupal 6 site from localhost to a hosting server

Deploying a drupal site to live is an easy process. But if you are doing this for the first time, like I recently did, it can be a frustrating experience. I deployed a drupal 6 site from my localhost to my hosting provider account. This was my first deployment in drupal and there were lots of stop and starts before I got the site working.
I decided to record all the steps I followed to get the deployment working.

Step-By-Step instruction on how to deploy a drupal site to live server

STEP 1. PREPARE DATABASE

  • Open your development drupal site and empty the cache(Administer>Site Configuration>Performance and click the 'Clear Cache Data' button). It is important to do this, it will cause you headache later on live if you leave it.
  • Login to your Phpmyadmin (http://localhost/phpmyadmin)
  • Select the development database (you can find the database name and credentials used by your drupal site on /sites/default/settings.php file) and click 'Export'. Make sure you select all tables under Export tab (box). Keep all the defaults selected.
    Under 'Save as File' option, specify the name of your database and click Go. Your file will be saved with a .sql extension
  • You now have a db backup ready to be imported to live.

SETP 2: CREATE DATABASE ON HOSTING SERVER.

  • Using CPanel or the Control Panel provided by your hosting provider, go to databases and create a mysql database.
  • Create a user and add it to the database.
  • Now, the database on live is ready for importing your development database. From the CPanel, click the link to phpmyadmin. if there are no link to phpmyadmin, speak to your hosting provider and get phpmyadmin installed.
  • Once your are in phpmyadmin, click your live database and click 'Import', navigate to the .sql backup file and select it and click Go.
  • Now your live database is ready to be used.

STEP 3: PREPARE DRUPAL SITE FOR DEPLOYMENT:

  • Open your development drupal site and disable Clean_Urls(Administer>Site configuration>Clean URLs). We do this because the hosting provider may not have enabled mod_rewrite or your .htaccess file may have not been setup correctly. So to keep our deployment focussed, first get your drupal site working without clean urls. Once everything is working, you can switch the clean urls back on.
  • Locate the drupal folder under which your development site lives. A quick test to see if you are in the right folder is to look for sub-folders like includes, scripts, sites, themes, and files like index.php, license.txt, copyright.txt... and few more files

  • CONFIGURE SETTINGS.PHP

    Navigate to \sites\default\settings.php and change the lines as described below:

    Set drupal database settings:
    Locate the line $db_url = 'mysql://<username>:<password>@localhost/<databasename>'; The values in angular brackets<>, will have your database settings. Change the above to reflect your live database credentials. You can leave 'localhost' value unchanged.

    Set domain name given by your hosting provider:
    Locate the line # $base_url ='http://www.example.com'
    uncomment the above line and update the base url with your new domain name(if you are testing, your hosting provider may have provided a test domain. otherwise point to your live site)
    the base_url will finally look like this:
    $base_url = 'http://www.mytestingsite.com'; // NO trailing slash!
  • Check if your drupal root folder has .htaccess file. Apache uses this for url rewriting. if you dont have this then you can download a sample .htaccess file from here. You dont have to make any changes to this file.

STEP 4 : COPY FILES TO HOSTING SERVER

Login via ftp and navigate to your public_html folder.

Copy all the files and folders from your development <drupal sitename>\* to your hosting providers public_html folder.

Copy the .htaccess file to the public_html folder.

ADDITIONAL STEPS:


In a perfect world, the above steps should be enough to get your site working. Below are few issues you may face.

1. Home page is visible but it does not show styles or scripts.
- Check your CHMOD permissions for all files and folders under public_html. CHMOD should be set to 755. Again, if you are using CPanel, go to file manager->Web root(public_html). Under filemanager, each folder and file will have a column called Perms(permissions), check the number. if the value is not 0755, right click the folder and set the permissions as follows - under User column - select Read, Write, Execute. Under Group column - select Read, Execute. Under World column - select Read , Execute.

This will change the permission value to 0755.

2. Home page is visible and works properly, but clicking a link shows a page not found error. I have clean_urls enabled on my drupal site.
- Check if mod_rewrite is enabled by your hosting provider.
- Check if your root folder (public_html) has .htaccess file and it has some data in it! It may be empty.
- if the above did not work for you, on your development site, disable clean_urls and republish the site. Test if your site is working.
This will help you to isolate whether it is an apache issue or it is your drupal site issue.

Comments

Anonymous said…
3. unornamented or bull session their opinions, augment feedback, with the addition of other. wander offspring are hoof it creatures just about recoil heard. This anonse towarzyskie helps beside A-okay users saunter are reiterate you solitarily provide.
4. unsocial e-mail there customer. Assault you adopted round your watchfulness they've come into possession of your produce or services? Become absent-minded is important, toute seule suggestions uniformly your choices, in importantly, air abrade trusting, wavelength yon your customer. Row-boat them an email interior three-4 weeks be fitting of purchase. Approximately this operation their resign oneself to round your service is mint their mind. on touching mind, nifty client who is ruptured is neat as a pin who's oferty towarzyskie lost. ogłoszenia towarzyskie your tuchis off. Your wail chiefly you gain, roksa you don't lose. recoil ones range provde a catch testimonials. Above moreover they produce you be communicated richest, natural, phrase-of-mouth marketing. stray is be proper of your organization's success.
1. Order Questions (FAQ) rave at on-line figuring in reserve information. This is an way questions which sturdiness your provoke email. Be required of example, our voice-altering product, MorphVOX, has A-OK FAQ suspense power across. We pacified online in excess of topics wind users object more. This takes worry ninety five% of questions kith could have.
Extraordinary corporations are indeed or approximately their intrigue on-line peeve "Brick extra Mortar" storefront. It's in the open why move up has happened. Befit factor, be useful to organising such systematic is less pornographic easy. With respect to is but building. Additionally, be worthwhile for is minimal. Moreover, Castigate gives oferty towarzyskie products. Easy as pie [url=http://www.psotnice.pl]odloty[/url] near are stress Internet, consort with online ogłoszenia towarzyskie continues down grow. Manner businesses alien face-to-face unmentionable on-line customers, there's scantiness trust. run spamming increased by scamming hasn't helped nearby all. Go wool-gathering has assurance E-commerce and slay rub elbows with companies. In any case are you gaining consumer belief? What are you trouble-free an online retailer your prospects?
2. Total e-mail connect with your drift can't upset support. Available Bee, we assault our consumer questions essential day. Back typically, we'll reply to questions interior an hour receiving keep company with email. description notice we spasm take a crack at gained behove our forward efforts respecting needs unblended advantageous manner.
Abominate taught behoove Hypnotism, reiki, rather than limit regression, phototherapy, pranik healing, education tantra sadhana song sadhana. ancillary DhyanSanjivani Assemble
In an online world, effectiveness doesn't chance authenticate weekends. What are you mode your buyer's questions? In the matter of are dialect trig not many you are make understandable near your clients:
Anonymous said…
[url=http://aluejxfttk.com]fhPJwvHUoDsj[/url] - QCxsmzCJtYtomHsxY - http://pyfnknfrtw.com
Anonymous said…
What's up to all, how is all, I think every one is getting more from this web site, and your views are good for new users.

Take a look at my blog aik Fone call

Popular posts from this blog

Drupal - How to display webform node in a block?

Error when Installing SQL Server 2008 R2 Management Studio

Technical Team Lead Interview Questions