Category: PHP


BlackBoard Course Migration To Moodle

Step-by-Step guide for migrating courses from the Blackboard standard  version to moodle version > 1.9.

Black Board Categorisation :

For the purpose of course migration to Moodle, Blackboard can be categorised into 3 different systems, each with a different migration procedure.

  • CE 4.0/CE 4.1 (rebranded WebCT) [ can use the webctimport tool with the “IMS Content Migration Utility”]
  • Standard Blackboard (5.5, 6, 7, 8, 9, 9.1) [ Follow the mentioned Process in this article]
  • Vista3/Vista4/Vista8 and CE 6/CE 8 (rebranded WebCT) [ backup files are encrypted so can not import that ]

The following process tested on a standard blackboard 9.1 Q4 course export file and importing that into moodle 2.7 LTS after following below steps”

Objective  :

Migrating courses from blackboard Standard 9.1 Q4 version to Moodle 2.7, via exporting from Blackboard and importing that into Moodle.

** The reason to say moodle version > 1.9 is , all the versions utilise the moodle2 process to import and before moodle 2.0 (i.e moodle 1.9 and before) the  process was different. However “ > moodle 2.0” was supplied with an inbuilt converter, which supports but upto a limit and without any assurity.

Solution :

To achieve the target , you need to follow the below steps:

1 . Setup the Conversion Tool #step-1

2. Convert the exported BB (blackboard file) to Moodle 1.9 zip file via conversion tool #step-2

3 . Make some mentioned changes in moodle code and DB for moodle version > 1.9 #step-3


You can import it in moodle 1.9 and then upgrade moodle to 2.0 and export it to moodle 2 compatible import 

4 . Import the Converted file into Moodle version > 1.9 #step-4

Step-1 : –

Conversion Tool can be download from here or

or update version is available at :
Assuming that you are using linux environment.

  • Pre-requisite  : python2 and pip is installed

If not , then install python 2 and pip first, steps are –

Check for python

>>>  python --version 

If python not found :

Install pip and setup tools

>>> sudo apt-get install python-setuptools


>>> curl -o

>>> python

Now you have installed Python and pip and I assume that you have downloaded the conversion tool zip file. Let’s say you are under the directory /var/www/html and conversion tool is present at /var/www/html/

  • Unzip that file , the directory reteach should be created.
  • Go inside that directory , location /var/www/html/retach
  • file will be there
  • Run following command  >>> pip install .
  • Package has been installed, you can cross check via typing reteach  >>> reteach
  • If reteach is not found than please try python reteach and try after running following command export PATH=$PATH:~/.local/bin

Step-2 : 

You just need to run this command 

>>> reteach -o   is then name of bb course zip file name . I assume that you are currently present under the directory where is present will be converted zip file that will be used to import in moodle.

Step-3 : –

If you are utilising moodle > 1.9, Update the following code 

Line number 1257 File: backup/converter/moodle1/handlerlib.php

// replay the upgrade step 2011060301 – Rename field defaultgrade on table question to defaultmark
$data[‘defaultmark’] = $data[‘defaultgrade’];

       // code to add for for blackboard course
        $data['generalfeedbackformat'] = '1';
        $data['createdby'] = '2'; // can be change
        $data['modifiedby'] = '2'; // can be change
// END

And run the query: ALTER TABLE `mdl_qtype_match_subquestions` CHANGE `answertext` `answertext` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;

Step -4 :

  Import that into Moodle setup , and you are done.

Ref :

Files To download :

If you need sample file, feel free to ask . I will share one.

Apache Web Server Basic Security fixes and Optimisation: –

If you are utilising the apache web server HTTP for your website hosting and you maintain that server, then you must consider the following points,

  • Turn on LOGS and installing mod_log_config. You can check the list of modules by this command : apache2ctl -M
  • Implement Firewall MOD_SECURITY module is an open source, cross-platform web application firewall (WAF) module. Known as the "Swiss Army Knife" of WAFs, it enables web application defenders to gain visibility into HTTP(S) traffic and provides a power rules language and API to implement advanced protections.
  • Implement mod_evasive module
  • Disable Extra  module which are not utilized to improve performance
  • Cross check  Directory Indexing. apache2.conf | httpd.conf | <vhost>.conf | .htaccess
    Options -Indexes
  • Setup following variables in apache2.conf or httpd.conf
    SET HTTP Limits
    • KeepAlive=on
    • KeepAliveTimeout
    • LimitRequestBody
    • LimitRequestFields
    • LimitRequestFieldSize
    • LimitRequestLine
    • LimitXMLRequestBody
    • MaxClients
    • MaxKeepAliveRequests
    • MaxRequestWorkers
    • RequestReadTimeout
    • TimeOut
  • Disable server signature . Add these lines in apache2.conf |  <vhost>.conf | .htaccess
    ServerSignature Off
    ServerTokens Prod
server signature
  • If web-server language is PHP,  By Default PHP version is available in response header, Remove PHP version from header from php.ini
    • expose_php = Off
  • Add these headers  to prevent XSS

X-Frame-Options: SAMEORIGIN 
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8