<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def migrate(dest_datastore, source_datastore):
 """ Copy all records from source_datastore to dest_datastore """

        for uid in source_datastore.list():
            try:
                paste = source_datastore._retrieve(uid)
            except Exception as exc:
                print(
                    "{exc.__class__.__name__} occurred retrieving {uid}: {exc}"
                    .format(exc=exc, uid=uid),
                    file=sys.stderr)
                continue
            data = paste.pop('data', None)
            try:
                dest_datastore._store(uid, paste, data)
            except Exception as exc:
                print(
                    "{exc.__class__.__name__} occurred storing {uid}: {exc}"
                    .format(exc=exc, uid=uid),
                    file=sys.stderr)
                continue