2 of 2 update dbatools link

I use powershell based Sync-DbaSqlLoginPermission

This command syncs SQL login permissions from one server to another including login permissions, roles, database permissions and more. By default, all logins are synced. The -Logins and -Excludes parameters is autopopulated for command-line completion and can be used to sync only specific logins.

If a matching login or securable does not exist on the destination, the permission sync will be skipped.

Credential removal and application role syncs not currently supported.

Or You can use TSQL based Script DB Level Permissions v3