• I did a clean install of wordpress, used the xml to import posts and pages, but all my subscribers are gone.

    I have the backup of the old database (.sql) but I only want to import the users while keeping their own passwords. How do I do that?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Users are kept in the wp_users and wp_usermeta tables.

    See Database Description.

    If you did a clean install, then you could just drop the tables from that install and import the sql file from your old backup…then you would have everything. If you changed the url, then you should edit the sql file doing a search/replace on the url.

    Backup everything first….

    Thread Starter aminalcwakerz

    (@aminalcwakerz)

    sorry, but i’m a total noob at this. Which tab in phpmyadmin do I insert the tables? I had my entire database backed up from the original site (URL remains the same) Do I just copy and paste these?

    INSERT INTO wp_usermeta VALUES (1631, 60, ‘first_name’, ‘Tom’);
    INSERT INTO wp_usermeta VALUES (1632, 60, ‘last_name’, ‘Sky’);
    INSERT INTO wp_usermeta VALUES (1633, 60, ‘user_url’, ‘www.tomsky.org’);
    INSERT INTO wp_usermeta VALUES (1634, 60, ‘description’, ‘Photographer, musician, designer, philosopher,’);
    INSERT INTO wp_usermeta VALUES (1635, 60, ‘gender’, ‘ Male’);
    INSERT INTO wp_usermeta VALUES (1636, 60, ‘age’, ’37’);
    INSERT INTO wp_usermeta VALUES (1637, 60, ‘ethnicity’, ‘ White’);
    INSERT INTO wp_usermeta VALUES (1638, 60, ‘marital_status’, ‘ Single’);
    INSERT INTO wp_usermeta VALUES (1639, 60, ‘income_level’, ‘ $50k-99k’);
    INSERT INTO wp_usermeta VALUES (1640, 60, ‘education’, ‘ Trade School’);
    INSERT INTO wp_usermeta VALUES (1641, 60, ‘zip_code’, ‘90802’);
    INSERT INTO wp_usermeta VALUES (1642, 60, ‘how_did_you_hear_about_us’, ‘ Hard Copy Location’);
    INSERT INTO wp_usermeta VALUES (1643, 60, ‘please_specify_’, ‘LA Downtown ART WALK’);
    INSERT INTO wp_usermeta VALUES (1644, 61, ‘nickname’, ‘Testing’);
    INSERT INTO wp_usermeta VALUES (1645, 61, ‘rich_editing’, ‘true’);
    INSERT INTO wp_usermeta VALUES (1646, 61, ‘comment_shortcuts’, ‘false’);
    INSERT INTO wp_usermeta VALUES (1647, 61, ‘admin_color’, ‘fresh’);
    INSERT INTO wp_usermeta VALUES (1648, 61, ‘wp_capabilities’, ‘a:1:{s:10:”subscriber”;b:1;}’);
    INSERT INTO wp_usermeta VALUES (1649, 61, ‘first_name’, ‘test’);
    INSERT INTO wp_usermeta VALUES (1650, 61, ‘last_name’, ‘Tests’);
    INSERT INTO wp_usermeta VALUES (1651, 61, ‘gender’, ‘Choose’);
    INSERT INTO wp_usermeta VALUES (1652, 61, ‘ethnicity’, ‘ American Indian/Alaskan Native’);
    INSERT INTO wp_usermeta VALUES (1653, 61, ‘marital_status’, ‘ Divorced’);
    INSERT INTO wp_usermeta VALUES (1654, 61, ‘income_level’, ‘ $25k-$49k’);
    INSERT INTO wp_usermeta VALUES (1655, 61, ‘education’, ‘ High School’);
    INSERT INTO wp_usermeta VALUES (1656, 61, ‘zip_code’, ‘90045’);
    INSERT INTO wp_usermeta VALUES (1657, 61, ‘how_did_you_hear_about_us’, ‘ Search Engine’);
    INSERT INTO wp_usermeta VALUES (1658, 61, ‘please_specify_’, ‘Google’);
    INSERT INTO wp_usermeta VALUES (1659, 62, ‘nickname’, ‘sophie’);
    INSERT INTO wp_usermeta VALUES (1660, 62, ‘rich_editing’, ‘true’);
    INSERT INTO wp_usermeta VALUES (1661, 62, ‘comment_shortcuts’, ‘false’);
    INSERT INTO wp_usermeta VALUES (1662, 62, ‘admin_color’, ‘fresh’);
    INSERT INTO wp_usermeta VALUES (1663, 62, ‘wp_capabilities’, ‘a:1:{s:10:”subscriber”;b:1;}’);
    INSERT INTO wp_usermeta VALUES (1664, 62, ‘first_name’, ‘Sophie’);
    INSERT INTO wp_usermeta VALUES (1665, 62, ‘last_name’, ‘Kipner’);
    INSERT INTO wp_usermeta VALUES (1666, 62, ‘user_url’, ‘http://forthmagazine.com/’);
    INSERT INTO wp_usermeta VALUES (1667, 62, ‘gender’, ‘ Female’);
    INSERT INTO wp_usermeta VALUES (1668, 62, ‘ethnicity’, ‘ White’);
    INSERT INTO wp_usermeta VALUES (1669, 62, ‘marital_status’, ‘ Single’);
    INSERT INTO wp_usermeta VALUES (1670, 62, ‘income_level’, ‘Choose’);
    INSERT INTO wp_usermeta VALUES (1671, 62, ‘education’, ‘Choose’);
    INSERT INTO wp_usermeta VALUES (1672, 62, ‘zip_code’, ‘90290’);
    INSERT INTO wp_usermeta VALUES (1673, 62, ‘how_did_you_hear_about_us’, ‘ Other’);
    INSERT INTO wp_usermeta VALUES (1674, 62, ‘please_specify_’, ‘work’);
    INSERT INTO wp_usermeta VALUES (1675, 63, ‘nickname’, ‘mushka’);
    INSERT INTO wp_usermeta VALUES (1676, 63, ‘rich_editing’, ‘true’);
    INSERT INTO wp_usermeta VALUES (1677, 63, ‘comment_shortcuts’, ‘false’);
    INSERT INTO wp_usermeta VALUES (1678, 63, ‘admin_color’, ‘fresh’);
    INSERT INTO wp_usermeta VALUES (1679, 63, ‘wp_capabilities’, ‘a:1:{s:10:”subscriber”;b:1;}’);
    INSERT INTO wp_usermeta VALUES (1680, 63, ‘first_name’, ‘Sarah’);
    INSERT INTO wp_usermeta VALUES (1681, 63, ‘user_url’, ‘www.mushkadesigns.com’);
    INSERT INTO wp_usermeta VALUES (1682, 63, ‘gender’, ‘ Female’);
    INSERT INTO wp_usermeta VALUES (1683, 63, ‘age’, ’29’);
    INSERT INTO wp_usermeta VALUES (1684, 63, ‘ethnicity’, ‘Choose’);
    INSERT INTO wp_usermeta VALUES (1685, 63, ‘marital_status’, ‘ Married’);
    INSERT INTO wp_usermeta VALUES (1686, 63, ‘income_level’, ‘Choose’);
    INSERT INTO wp_usermeta VALUES (1687, 63, ‘education’, ‘Choose’);
    INSERT INTO wp_usermeta VALUES (1688, 63, ‘zip_code’, ‘33154’);
    INSERT INTO wp_usermeta VALUES (1689, 63, ‘how_did_you_hear_about_us’, ‘ Other’);
    INSERT INTO wp_usermeta VALUES (1690, 63, ‘please_specify_’, ‘friend’);

    No, you can’t just copy/paste. You are only showing the usermeta table values above…if you follow the tip form MichaelH, then you need to also get the wp_user data as well. You could drop those two existing tables, edit your sql file to only leave those tables and then import it. Or, you could drop all the tables and import the complete sql file.

    I’m in the midst of doing much the same – moving to another host. If IU understand correctly from the above if I take my old sql database, erase all tables except wp_user and save that database, then go to the new host database, drop the equivalent table then import the old, edited database, I’ll have the users from the old database?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Importing Users only after switching hosts.’ is closed to new replies.