Well, for the first one I think you could do this:
Code:
REPLACE INTO To_subscriptionlog (subscriptionlogid, subscriptionid, userid, pusergroupid, status, regdate, expirydate, importsubscriptionlogid)
SELECT id, subid, userid, termid, active, stime, etime, 0 FROM From_subscriptions_data
but I haven't tested it. That will replace lines with duplicate keys. If you wanted to ignore lines with duplicate keys you could change REPLACE to INSERT IGNORE. Edit: but without any "order by" on the select you don't know which order you'll be inserting the records, so if you have rows in From_subscriptions_data that would result in duplicate keys in To_subscriptionlog, you probably need to figure out a better way to handle it.
If afraid the rest of it is beyond my SQL ability. Hopefully someone else will help.