1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 Copy "location" data to a custom field

Discussion in 'XenForo Questions and Support' started by Nudaii, Feb 27, 2014.

  1. Nudaii

    Nudaii Well-Known Member

    is there a way to copy the contents of the "location" field to a custom profile field?

    If so what would be the SQL query?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Usually people go the opposite direction:


    If you want to go location to custom field then use this:

    UPDATE xf_user_field_value AS ufv
    SET ufv.field_value = (
    	SELECT up.location
    	FROM xf_user_profile AS up
    	WHERE ufv.user_id = up.user_id
    WHERE ufv.field_id = 'customfield';
    Then rebuild the user cache:

    Admin CP -> Tools -> Rebuild Caches -> Rebuild User Caches

    Backup to be safe.

Share This Page