Answers.Body: <p>Assuming you have done something like that :</p>
  <ul>
  <li>install Wordpress</li>
  <li>install an empty CiviCRM on Wordpress</li>
  <li>create the users in Wordpress with the same email as the primary email of their contact in CiviCRM</li>
  <li>copy CiviCRM database and reset the path or update them as needed</li>
  </ul>
  <p>You should be able to fix the users / contact link by updating the <code>civicrm_uf_match</code> table with a sql query like :</p>
  <pre><code>UPDATE civicrm_uf_match uf 
    INNER JOIN civicrm_email e ON uf.contact_id = e.contact_id AND e.is_primary = 1 
    INNER JOIN wp_users u ON u.user_email = e.email
  SET uf.uf_id = u.id;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-28T21:06:38.147Z
Answers.LastActivityDate: 2022-06-28T21:06:38.147Z
Answers.UserDisplayName: samuelsov
Body: <p>We're in the process of migrating from Drupal to Wordpress. The initial migration went without a hitch and we're now setting up new contribution forms in the new site. The plan is to reimport the users once we are ready to go live with the Wordpress site as the tables will be out of sync by then. So, is there a way of migrating just the user data at a later date without overwriting the other work we will have done in the system?</p>
  <p>Thanks</p>
  <p>Chris</p>
  
Tags: <wordpress><drupal><import>
Title: Reimport users after migration to Wordpress
ThreadText: # Reimport users after migration to Wordpress
  
  (Asked by: username_0 on 2022-06-28)
  
  We're in the process of migrating from Drupal to Wordpress. The initial migration went without a hitch and we're now setting up new contribution forms in the new site. The plan is to reimport the users once we are ready to go live with the Wordpress site as the tables will be out of sync by then. So, is there a way of migrating just the user data at a later date without overwriting the other work we will have done in the system?
  
  Thanks
  
  Chris
  
  **Tags:** wordpress, drupal, import
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-06-28. Score: 0
  
  Assuming you have done something like that :
  
  * install Wordpress
  * install an empty CiviCRM on Wordpress
  * create the users in Wordpress with the same email as the primary email of their contact in CiviCRM
  * copy CiviCRM database and reset the path or update them as needed
  
  You should be able to fix the users / contact link by updating the `civicrm_uf_match` table with a sql query like :
  
  ```
  UPDATE civicrm_uf_match uf 
    INNER JOIN civicrm_email e ON uf.contact_id = e.contact_id AND e.is_primary = 1 
    INNER JOIN wp_users u ON u.user_email = e.email
  SET uf.uf_id = u.id;
  
  ```
  
  
  ---
  
  