Assuming your have your credentials setup on your my.cnf a command like this may do what you want.
mysql --batch --skip-column-names --execute \
'select concat("alter table ",TABLE_SCHEMA,".",TABLE_NAME," type=innodb;")
from information_schema.TABLES where TABLE_SCHEMA="database_name"' | mysql
Of course replace database_name with your database name.
As for you main issue. It sounds like you want to reclaim space after letting your innodb tables get large. Like the bug said, the only safe way to deal with this is to use mysqldump to export everything. Delete the files and then restore.
As that article notes. You can enable
innodb_file_per_table option to your server's my.cnf will make each file exist as a separate file. That way reclaiming space can be done by deleting/restoring the problem table instead of everything.