'Syncing all session ids of the portal with the ones of the
server. This is instantiated by the portal when reconnecting.
Args:
portalsessionsdata (dict): A dictionary
`{sessid: {property:value},...}` defining each session and
the properties in it which should be synced.'

def portal_sessions_sync(self, portalsessionsdata):

    delayed_import()
    global _ServerSession, _PlayerDB, _ServerConfig, _ScriptDB
    for sess in self.values():
        del sess
    for (sessid, sessdict) in portalsessionsdata.items():
        sess = _ServerSession()
        sess.sessionhandler = self
        sess.load_sync_data(sessdict)
        if sess.uid:
            sess.player = _PlayerDB.objects.get_player_from_uid(sess.uid)
        self[sessid] = sess
        sess.at_sync()
    self.server.at_post_portal_sync()
    self.announce_all(_('    ...    Server    restarted.'))
