Problem converting tags to categories while having large number of tags

Yes, there is a SQL-based method to do this.

Just run this SQL (it will convert all tags to categories, if you want to convert only some of them, you have to add your conditions to WHERE clause):

UPDATE wp_term_taxonomy SET taxonomy='category' WHERE taxonomy='post_tag'

You can do this using $wpdb:

$wpdb->query( "UPDATE $wpdb->term_taxonomy SET taxonomy='category' WHERE taxonomy='post_tag'" );