private function updateUsers(EntityManager $em)
    {
        $em->getConnection()->executeUpdate(
            'INSERT INTO Users
            (
                id,                     activity,               address,                admin,
                can_change_ftp_profil,  can_change_profil,      city,                   company,
                country,                email,                  fax,                    first_name,
                geoname_id,             guest,                  job,                    last_connection,
                last_name,              ldap_created,           locale,                 login,
                mail_locked,            last_model,             mail_notifications,     nonce,
                password,               push_list,              request_notifications,  salted_password,
                gender,                 phone,                  timezone,               zip_code,
                created,                updated,                deleted
            )
            (
                SELECT
                usr_id,                 activite,               adresse,                create_db,
                canchgftpprofil,        canchgprofil,           ville,                  societe,
                pays,                   usr_mail,               fax,                    usr_prenom,
                geonameid,              invite,                 fonction,               last_conn,
                usr_nom,                ldap_created,           locale,                 usr_login,
                mail_locked,            NULL AS lastModel,      mail_notifications,     '.($this->hasField($em, 'nonce') ? 'nonce' : 'NULL AS nonce').',
                usr_password,           push_list,              request_notifications,  '.($this->hasField($em, 'salted_password') ? 'salted_password' : '0 AS salted_password').',
                usr_sexe,               tel,                    timezone,               cpostal,
                usr_creationdate,       usr_modificationdate,   0
                FROM usr
            )'
        );

        $em->getConnection()->executeUpdate('UPDATE Users SET geoname_id=NULL WHERE geoname_id=0');
        $em->getConnection()->executeUpdate(
            'UPDATE Users SET locale=NULL WHERE locale NOT IN (:locales)',
            ['locales' => array_keys(Application::getAvailableLanguages())],
            ['locales' => Connection::PARAM_STR_ARRAY]
        );
        $em->getConnection()->executeUpdate('UPDATE Users SET deleted=1, login=SUBSTRING(login, 11) WHERE login LIKE "(#deleted_%"');
    }