"Database failure" after upgrade

I upgraded sugarcrm 6.5.20 to suitCRM, all ok except at the last step of upgrade > confirm layout,
http://screencast.com/t/qOtqlM2nPT

when I clicked next, showed “Database failure”

I tried to run Quick Repair and Rebuild, at the bottom I was asked to run below query. I execute it, also got “Database failure”, I then tried to run the sql in phpmyadmin directly, then error saying duplicated tables.

/* Table : email_marketing */
/*COLUMNS*/
/*MISSING IN DATABASE - outbound_email_id -  ROW*/
/* INDEXES */
ALTER TABLE email_marketing   add COLUMN outbound_email_id char(36)  NULL ;
/* Table : reminders */
/*COLUMNS*/
/* INDEXES */
/*MISSING INDEX IN DATABASE - idx_reminder_name -index  ROW */
/*MISSING INDEX IN DATABASE - idx_reminder_deleted -index  ROW */
/*MISSING INDEX IN DATABASE - idx_reminder_related_event_module -index  ROW */
/*MISSING INDEX IN DATABASE - idx_reminder_related_event_module_id -index  ROW */
ALTER TABLE reminders   ADD INDEX idx_reminder_name (name),  ADD INDEX idx_reminder_deleted (deleted),  ADD INDEX idx_reminder_related_event_module (related_event_module),  ADD INDEX idx_reminder_related_event_module_id (related_event_module_id);
/* Table : reminders_invitees */
/*COLUMNS*/
/* INDEXES */
/*MISSING INDEX IN DATABASE - idx_reminder_invitee_name -index  ROW */
/*MISSING INDEX IN DATABASE - idx_reminder_invitee_assigned_user_id -index  ROW */
/*MISSING INDEX IN DATABASE - idx_reminder_invitee_reminder_id -index  ROW */
/*MISSING INDEX IN DATABASE - idx_reminder_invitee_related_invitee_module -index  ROW */
/*MISSING INDEX IN DATABASE - idx_reminder_invitee_related_invitee_module_id -index  ROW */
ALTER TABLE reminders_invitees   ADD INDEX idx_reminder_invitee_name (name),  ADD INDEX idx_reminder_invitee_assigned_user_id (assigned_user_id),  ADD INDEX idx_reminder_invitee_reminder_id (reminder_id),  ADD INDEX idx_reminder_invitee_related_invitee_module (related_invitee_module),  ADD INDEX idx_reminder_invitee_related_invitee_module_id (related_invitee_module_id);
/* Table : aos_contracts */
/*COLUMNS*/
/*MISSING IN DATABASE - total_contract_value_usdollar -  ROW*/
/*MISSING IN DATABASE - contact_id -  ROW*/
/*MISSING IN DATABASE - total_amt -  ROW*/
/*MISSING IN DATABASE - total_amt_usdollar -  ROW*/
/*MISSING IN DATABASE - subtotal_amount -  ROW*/
/*MISSING IN DATABASE - subtotal_amount_usdollar -  ROW*/
/*MISSING IN DATABASE - discount_amount -  ROW*/
/*MISSING IN DATABASE - discount_amount_usdollar -  ROW*/
/*MISSING IN DATABASE - tax_amount -  ROW*/
/*MISSING IN DATABASE - tax_amount_usdollar -  ROW*/
/*MISSING IN DATABASE - shipping_amount -  ROW*/
/*MISSING IN DATABASE - shipping_amount_usdollar -  ROW*/
/*MISSING IN DATABASE - shipping_tax -  ROW*/
/*MISSING IN DATABASE - shipping_tax_amt -  ROW*/
/*MISSING IN DATABASE - shipping_tax_amt_usdollar -  ROW*/
/*MISSING IN DATABASE - total_amount -  ROW*/
/*MISSING IN DATABASE - total_amount_usdollar -  ROW*/
/* INDEXES */
ALTER TABLE aos_contracts   add COLUMN total_contract_value_usdollar decimal(26,6)  NULL ,  add COLUMN contact_id char(36)  NULL ,  add COLUMN total_amt decimal(26,6)  NULL ,  add COLUMN total_amt_usdollar decimal(26,6)  NULL ,  add COLUMN subtotal_amount decimal(26,6)  NULL ,  add COLUMN subtotal_amount_usdollar decimal(26,6)  NULL ,  add COLUMN discount_amount decimal(26,6)  NULL ,  add COLUMN discount_amount_usdollar decimal(26,6)  NULL ,  add COLUMN tax_amount decimal(26,6)  NULL ,  add COLUMN tax_amount_usdollar decimal(26,6)  NULL ,  add COLUMN shipping_amount decimal(26,6)  NULL ,  add COLUMN shipping_amount_usdollar decimal(26,6)  NULL ,  add COLUMN shipping_tax varchar(100)  NULL ,  add COLUMN shipping_tax_amt decimal(26,6)  NULL ,  add COLUMN shipping_tax_amt_usdollar decimal(26,6)  NULL ,  add COLUMN total_amount decimal(26,6)  NULL ,  add COLUMN total_amount_usdollar decimal(26,6)  NULL ;
/* Table : aow_workflow */
/*COLUMNS*/
/*MISMATCH WITH DATABASE - run_when -  ROW [name] => 'run_when'  [type] => 'varchar'  [len] => '100'  [default] => 'Create'  */
/* VARDEF - run_when -  ROW[required] => ''  [name] => 'run_when'  [vname] => 'LBL_RUN_WHEN'  [type] => 'varchar'  [massupdate] => '0'  [default] => 'Always'  [comments] => ''  [help] => ''  [importable] => 'true'  [duplicate_merge] => 'disabled'  [duplicate_merge_dom_value] => '0'  [audited] => ''  [reportable] => '1'  [unified_search] => ''  [merge_filter] => 'disabled'  [len] => '100'  [size] => '20'  [options] => 'aow_run_when_list'  [studio] => 'visible'  [dependency] => ''  [dbType] => 'enum'  */
/* INDEXES */
ALTER TABLE aow_workflow   modify COLUMN run_when varchar(100)  DEFAULT 'Always' NULL ;
/* Table : jjwg_maps */
/*COLUMNS*/
/*MISMATCH WITH DATABASE - distance -  ROW [name] => 'distance'  [type] => 'float'  [len] => '26,4'  */
/* VARDEF - distance -  ROW[required] => ''  [name] => 'distance'  [vname] => 'LBL_DISTANCE'  [type] => 'float'  [massupdate] => '0'  [comments] => ''  [help] => 'Distance'  [importable] => 'true'  [duplicate_merge] => 'disabled'  [duplicate_merge_dom_value] => '0'  [audited] => '1'  [reportable] => '1'  [len] => '9,4'  [size] => '20'  [precision] => '4'  [dbType] => 'float'  */
/* INDEXES */
ALTER TABLE jjwg_maps   modify COLUMN distance float(9,4)  NULL ;
/* Table : outbound_email */
/*COLUMNS*/
/*MISSING IN DATABASE - date_entered -  ROW*/
/*MISSING IN DATABASE - date_modified -  ROW*/
/*MISSING IN DATABASE - modified_user_id -  ROW*/
/*MISSING IN DATABASE - created_by -  ROW*/
/*MISSING IN DATABASE - deleted -  ROW*/
/*MISSING IN DATABASE - assigned_user_id -  ROW*/
/*MISMATCH WITH DATABASE - mail_smtpssl -  ROW [name] => 'mail_smtpssl'  [type] => 'int'  [len] => '1'  */
/* VARDEF - mail_smtpssl -  ROW[name] => 'mail_smtpssl'  [vname] => 'LBL_MAIL_SMTPSSL'  [type] => 'varchar'  [len] => '1'  [default] => '0'  [reportable] => ''  [options] => 'email_settings_for_ssl'  [dbType] => 'enum'  [required] => ''  */
/* INDEXES */
ALTER TABLE outbound_email   add COLUMN date_entered datetime  NULL ,  add COLUMN date_modified datetime  NULL ,  add COLUMN modified_user_id char(36)  NULL ,  add COLUMN created_by char(36)  NULL ,  add COLUMN deleted bool  DEFAULT '0' NULL ,  add COLUMN assigned_user_id char(36)  NULL ,  modify COLUMN mail_smtpssl varchar(1)  DEFAULT '0' NULL ;
/* Table : templatesectionline */
/* MISSING TABLE: templatesectionline */
CREATE TABLE templatesectionline (id char(36)  NOT NULL ,name varchar(255)  NULL ,date_entered datetime  NULL ,date_modified datetime  NULL ,modified_user_id char(36)  NULL ,created_by char(36)  NULL ,description text  NULL ,deleted bool  DEFAULT '0' NULL ,assigned_user_id char(36)  NULL ,thumbnail varchar(255)  NULL ,grp varchar(255)  NULL ,ord int(11)  NULL  , PRIMARY KEY (id)) CHARACTER SET utf8 COLLATE utf8_general_ci;
/* Table : am_projectholidays */
/* MISSING TABLE: am_projectholidays */
CREATE TABLE am_projectholidays (id char(36)  NOT NULL ,name varchar(255)  NULL ,date_entered datetime  NULL ,date_modified datetime  NULL ,modified_user_id char(36)  NULL ,created_by char(36)  NULL ,description text  NULL ,deleted bool  DEFAULT '0' NULL ,assigned_user_id char(36)  NULL ,holiday_date date  NULL ,resourse_users varchar(100)  DEFAULT 'Contacts' NULL ,resource_id varchar(36)  NULL ,resource_type varchar(255)  NULL  , PRIMARY KEY (id)) CHARACTER SET utf8 COLLATE utf8_general_ci;
/* Table : aok_knowledgebase_categories */
/* MISSING TABLE: aok_knowledgebase_categories */
CREATE TABLE aok_knowledgebase_categories (id varchar(36)  NOT NULL ,date_modified datetime  NULL ,deleted bool  DEFAULT '0' NULL ,aok_knowledgebase_id varchar(36)  NULL ,aok_knowledge_base_categories_id varchar(36)  NULL  , PRIMARY KEY (id),   KEY aok_knowledgebase_categories_alt (aok_knowledgebase_id, aok_knowledge_base_categories_id)) CHARACTER SET utf8 COLLATE utf8_general_ci;
/* Table : am_projecttemplates_project_1_c */
/* MISSING TABLE: am_projecttemplates_project_1_c */
CREATE TABLE am_projecttemplates_project_1_c (id varchar(36)  NOT NULL ,date_modified datetime  NULL ,deleted bool  DEFAULT '0' NULL ,am_projecttemplates_project_1am_projecttemplates_ida varchar(36)  NULL ,am_projecttemplates_project_1project_idb varchar(36)  NULL  , PRIMARY KEY (id),   KEY am_projecttemplates_project_1_ida1 (am_projecttemplates_project_1am_projecttemplates_ida),   KEY am_projecttemplates_project_1_alt (am_projecttemplates_project_1project_idb)) CHARACTER SET utf8 COLLATE utf8_general_ci;
/* Table : am_tasktemplates_am_projecttemplates_c */
/* MISSING TABLE: am_tasktemplates_am_projecttemplates_c */
CREATE TABLE am_tasktemplates_am_projecttemplates_c (id varchar(36)  NOT NULL ,date_modified datetime  NULL ,deleted bool  DEFAULT '0' NULL ,am_tasktemplates_am_projecttemplatesam_projecttemplates_ida varchar(36)  NULL ,am_tasktemplates_am_projecttemplatesam_tasktemplates_idb varchar(36)  NULL  , PRIMARY KEY (id),   KEY am_tasktemplates_am_projecttemplates_ida1 (am_tasktemplates_am_projecttemplatesam_projecttemplates_ida),   KEY am_tasktemplates_am_projecttemplates_alt (am_tasktemplates_am_projecttemplatesam_tasktemplates_idb)) CHARACTER SET utf8 COLLATE utf8_general_ci;
/* Table : project_contacts_1_c */
/* MISSING TABLE: project_contacts_1_c */
CREATE TABLE project_contacts_1_c (id varchar(36)  NOT NULL ,date_modified datetime  NULL ,deleted bool  DEFAULT '0' NULL ,project_contacts_1project_ida varchar(36)  NULL ,project_contacts_1contacts_idb varchar(36)  NULL  , PRIMARY KEY (id),   KEY project_contacts_1_alt (project_contacts_1project_ida, project_contacts_1contacts_idb)) CHARACTER SET utf8 COLLATE utf8_general_ci;
/* Table : project_users_1_c */
/* MISSING TABLE: project_users_1_c */
CREATE TABLE project_users_1_c (id varchar(36)  NOT NULL ,date_modified datetime  NULL ,deleted bool  DEFAULT '0' NULL ,project_users_1project_ida varchar(36)  NULL ,project_users_1users_idb varchar(36)  NULL  , PRIMARY KEY (id),   KEY project_users_1_alt (project_users_1project_ida, project_users_1users_idb)) CHARACTER SET utf8 COLLATE utf8_general_ci;
/* Table : am_projectholidays_project_c */
/* MISSING TABLE: am_projectholidays_project_c */
CREATE TABLE am_projectholidays_project_c (id varchar(36)  NOT NULL ,date_modified datetime  NULL ,deleted bool  DEFAULT '0' NULL ,am_projectholidays_projectproject_ida varchar(36)  NULL ,am_projectholidays_projectam_projectholidays_idb varchar(36)  NULL  , PRIMARY KEY (id),   KEY am_projectholidays_project_ida1 (am_projectholidays_projectproject_ida),   KEY am_projectholidays_project_alt (am_projectholidays_projectam_projectholidays_idb)) CHARACTER SET utf8 COLLATE utf8_general_ci;

when I go to Studio > contract > Fields, there is no data there,
http://screencast.com/t/aDAqOD7HB

but I can see all the fields in Studio > contract > Labels, and I can see all the fields in my contract module pages too. all the data there.

all document file in the contract also lost.