Import data from BF Survey Plus

If you are an existing BF Survey Plus user, you may wish to migrate your data across to the new version.

This button will only be visible if you have BF Survey Plus installed on the same site.

[Warning]Warning

Warning, this is a destructive exercise and once you migrate the data you will no longer be able to use BF Survey Plus on that site (without reinstalling). It is recommended that you do a full site backup before pressing this button. Also it is recommended that you only use this button on a staging site, not on your live website.

[Warning]Warning

Warning, this Does not import your menu items settings (which are now located in the category table), so you will need to edit your category and set survey title etc after the import is complete.

Pressing this button will do the following:

  • Rename your existing jos_bfsurvey_questions to jos_bfsurvey_questions.old (just in case you need any of your current questions)

  • Add additional fieds to jos_bfsurvey_plus

  • Transform several fields in jos_bfsurvey_plus to their new name including id, catid, state, question, alias, sqlfield, created, modified

  • Rename jos_bfsurvey_plus to jos_bfsurvey_questions

  • Import your categories from jos_categories into jos_bfsurvey_categories

  • Update the category id in jos_bfsurvey_questions

  • Rename your answer table from the format jos_bfsurveyplus_34 to jos_bfsurvey_34results

  • Add missing fields to jos_bfsurvey_34results, and rename some existing ones

  • Adds an entry to jos_content_types for each category

  • Renames jso_bfsurveyplus_eamil to jos_bfsurvey_emailitems

As you can see, this button does quite a lot, and it's probably not going to work on every site. Use at your own risk.

Manual import

In the event of the above import failing, there may be a need to perform some of the steps manually. You can see all the import code in /administrator/components/com_bfsurvey/models/maintenance.php in the import function.

Here are the mySQL commands used to at least bring across your questions. Obviously replace #__ with your database table prefix such as jos_

RENAME TABLE `#__bfsurvey_questions` TO `#__bfsurvey_questions.old`;

ALTER TABLE `#__bfsurvey_plus` ADD `value_field` varchar(25) NOT NULL, ADD `hide_question` int(11) NOT NULL, ADD `hide_options` text, ADD `show_question` int(11) NOT NULL, ADD `show_options` text, ADD `default_value` varchar(255) NOT NULL, ADD `locked_by` bigint(20) NOT NULL DEFAULT '0', ADD `locked_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', ADD `myclass` varchar(255) NOT NULL;

ALTER TABLE `#__bfsurvey_plus` CHANGE `id` `bfsurvey_question_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT;

ALTER TABLE `#__bfsurvey_plus` CHANGE `catid` `bfsurvey_category_id` bigint(20) NOT NULL;

ALTER TABLE `#__bfsurvey_plus` CHANGE `state` `enabled` tinyint(3) NOT NULL DEFAULT '1';

ALTER TABLE `#__bfsurvey_plus` CHANGE `question` `title` varchar(255) NOT NULL;

ALTER TABLE `#__bfsurvey_plus` CHANGE `alias` `slug` varchar(50) NOT NULL;

ALTER TABLE `#__bfsurvey_plus` CHANGE `sqlfield` `key_field` varchar(25) NOT NULL;

ALTER TABLE `#__bfsurvey_plus` CHANGE `created` `created_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';

ALTER TABLE `#__bfsurvey_plus` CHANGE `modified` `modified_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';

UPDATE #__bfsurvey_plus SET value_field=key_field;

RENAME TABLE `#__bfsurvey_plus` TO `#__bfsurvey_questions`;

Go to top