Data upgrade 4.2.2 to 5.0.0 error message

Upgraded from 4.2.2 to 5.0.0 as per the wiki upgrade instructions. All went well. But when upgraded data from 4.2.2 to 5.0.0 per wiki I got error messages as seen below. (Using Windows 10). I can restore back to 4.2.2 and works fine.

OpenEMR Database Upgrade
Processing 4_2_2-to-5_0_0_upgrade.sql …
Starting conversion of *TEXT types to use default NULL.
amendments.amendment_desc sql column was successfully converted to text with default NULL setting.
amendments_history.amendment_note sql column was successfully converted to text with default NULL setting.
ar_activity.follow_up_note sql column was successfully converted to text with default NULL setting.
ar_session.description sql column was successfully converted to text with default NULL setting.
audit_details.field_value sql column was successfully converted to text with default NULL setting.
audit_master.comments sql column was successfully converted to text with default NULL setting.
automatic_notification.message sql column was successfully converted to text with default NULL setting.
clinical_rules_log.value sql column was successfully converted to text with default NULL setting.
clinical_rules_log.new_value sql column was successfully converted to text with default NULL setting.
customlists.cl_list_item_long sql column was successfully converted to text with default NULL setting.
documents_legal_detail.dld_denial_reason sql column was successfully converted to longtext with default NULL setting.
facility_user_ids.field_value sql column was successfully converted to text with default NULL setting.
history_data.exams sql column was successfully converted to text with default NULL setting.
history_data.usertext11 sql column was successfully converted to text with default NULL setting.
history_data.userarea11 sql column was successfully converted to text with default NULL setting.
history_data.userarea12 sql column was successfully converted to text with default NULL setting.
lang_custom.constant_name sql column was successfully converted to mediumtext with default NULL setting.
lang_custom.definition sql column was successfully converted to mediumtext with default NULL setting.
layout_options.conditions sql column was successfully converted to text with default NULL setting.
lbf_data.field_value sql column was successfully converted to text with default NULL setting.
lbt_data.field_value sql column was successfully converted to text with default NULL setting.
log_comment_encrypt.checksum sql column was successfully converted to longtext with default NULL setting.
notification_log.message sql column was successfully converted to text with default NULL setting.
notification_log.patient_info sql column was successfully converted to text with default NULL setting.
patient_data.industry sql column was successfully converted to text with default NULL setting.
patient_data.billing_note sql column was successfully converted to text with default NULL setting.
procedure_order.patient_instructions sql column was successfully converted to text with default NULL setting.
procedure_order_code.diagnoses sql column was successfully converted to text with default NULL setting.
procedure_providers.notes sql column was successfully converted to text with default NULL setting.
procedure_questions.options sql column was successfully converted to text with default NULL setting.
procedure_report.report_notes sql column was successfully converted to text with default NULL setting.
procedure_result.comments sql column was successfully converted to text with default NULL setting.
rule_action_item.reminder_message sql column was successfully converted to text with default NULL setting.
shared_attributes.field_value sql column was successfully converted to text with default NULL setting.
ALTER TABLE ar_activity MODIFY sequence_no int UNSIGNED NOT NULL COMMENT ‘Sequence_no, incremented in
code’
ALTER TABLE ar_activity ENGINE=“InnoDB”
ERROR: query failed: ALTER TABLE ar_activity ENGINE=“InnoDB”
Error: Error on rename of ‘.\openemr#sql-85b8_2’ to ‘.\openemr\ar_activity’ (errno: 184 “Tablespace already exists”)
C:\xampp\htdocs\openemr\library\sql_upgrade_fx.php at 675:sqlStatement
C:\xampp\htdocs\openemr\sql_upgrade.php at 56:upgradeFromSqlFile(4_2_2-to-5_0_0_upgrade.sql)

Hello tlzim,

Assuming your database is MySQL we suggest you the following.
1.The InnoDB engine uses idb(table data) and frm(table structure) files under location /var/lib/mysql/database name(ubuntu), In this location the ar_activity.frm file might be missing.So move the respective ar_activity.idb to safe location and recreate the table.
The issue can be resolved by deleting and recreating the table itself.
You can verify the issue here: https://stackoverflow.com/questions/15694168/error-tablespace-for-table-xxx-exists-please-discard-the-tablespace-before-imp.

2.Share your ar_activity table schema so we can analyse further on this issue.

Thanks,
ViSolve

Visolve,
Thank you for your response. By removing all the idb files present in our v.4.2.2 and then upgrading to version 5 on a test copy the upgrade proceeded as expected. Everything so far looks good. Plan to upgrade the original in the near future.
Thank you for your help and your quick response.
Tlzim