Why didn’t you use the backup/restore feature in Discourse?
The discourse remap script might help you here.
discourse remap