301 redirect from dynamic urls (id=123) to seo friendly urls

We have just released a new version of our website, part of which included moving from dynamic urls (index.php?id=123) to seo friendly urls (friendly-url)

The issue is that google has all of the old dynamic urls indexed and we’d like to be able to perform a 301 redirect from index.php?id=123 to /friendly-url for all of our indexed urls, until google has all the new friendly urls indexed

I’d rather not add 300+ individual redirects and wondered if there is an easier way to do this?

I was thinking another option would be to add a canonical link to each page to show the correct url to use, as I also want to make sure we are not penalised for duplicate content - But I’m not sure if this alone would tell google to stop indexing the old format urls

Thanks in advance

Try SEO Tab. It will automatically create the 301. If not, you can install it, and write a simple script in php to add rows to the database. SEO tab will do the rest.