Best way to consolidate "pending" items from database backups?

For any future reference, there’s another thread with a JavaScript that solves the problem: Duplicating a record between databases?