Cloning a database from one Discourse to another causes rebuild to fail on migration

It’ll be much easier if you just use the built in backup and restore. Just make sure that the site that you’re restoring to is at least as new as the one where you make the backup.