Redirect year month day postname permalink structure to category postname structure

I have a WordPress site with a /%year%/%monthnum%/%day%/%postname%/ permalink structure, and now the client wants it changed to /%category%/%postname%/.

How do I do a generic redirect for the old permalink structure to the new structure?

I checked out https://yoast.com/wp-content/permalink-helper.php, but it creates redirect code for /%year%/%monthnum%/%day%/%postname%/ to /%postname%/, instead of to /%category%/%postname%/

Solutions Collecting From Web of "Redirect year month day postname permalink structure to category postname structure"

Don’t need to do anything except change permalink.Just go to
settings->permalink->Custom Structure and add ‘/%category%/%postname%/’ to text box.
It will work same exactly what you want.

You dont need to install plugins to do this.
Go to Settings–>Permalinks–>Custom Structure–>
And now set this custom structure

www.example.com/%category%/%postname%/

It will do all the work of redirecting unless your htaccess has the write permissions.