+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Manually cleaning users from database

Manually cleaning users from database

4 posts, 1 answered
  1. Charles Lee
    Charles Lee avatar
    5 posts
    Registered:
    16 Jul 2009
    08 Sep 2009
    Link to this post
    I need to remove a subset of users from the various telerik_ database tables - using TSQL scripts. I have a handful of known UserID GUIDs that need to stay. The remaining accounts need to be deleted.

    Here are the tables I'm targeting for deleting users:
        telerik_Profile
        telerik_UserMetaInfo
        telerik_Users
        telerik_UserInRoles

    The script would look something like:
    DELETE FROM <telerik table name>
    WHERE UserID NOT IN (<list of GUIDs for accounts I want to keep>)

    A couple of questions:
    1) Are these all the tables and references to those users that I need to clean up? Or are there others?
    2) Can I safely delete the rows from the table using the script above?
    3) Are there any other considerations? (e.g. Delete from tables in a certain order, etc.)

    Thanks


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    08 Sep 2009
    Link to this post
    Hi Charles Lee,

    1) Are these all the tables and references to those users that I need to clean up? Or are there others?

    The tables you listed sore data for the users. telerik_Roles only contains information about the roles.

    2) Can I safely delete the rows from the table using the script above?

    The script will delete all users with ID that does not have reference to any of the other tables. I would like to suggest using the API instead of working with SQL scripts. You can use SQL script only in case there are problems that cannot be sorted with API.

    3) Are there any other considerations? (e.g. Delete from tables in a certain order, etc.)

    Since you are going to delete these users the order does not matter - your script is looking for missing userID in a tables.

    Please backup you database before proceeding. Changes to the database are not recoverable.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Charles Lee
    Charles Lee avatar
    5 posts
    Registered:
    16 Jul 2009
    09 Sep 2009
    Link to this post
    Ok. I'm not touching the telerik_Roles table.

    I wanted to check if there were any other tables Sitefinity writes to when a user is created. For example, there are a number of sf_ tables.

    If I only clean out the user account records from the telerik_ Profile, _UserMetaInfo, _Users, _UsersInRoles tables, I was concerned about orphaning records on other tables that might cause problems for Sitefinity.

    Thanks
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    09 Sep 2009
    Link to this post
    Hello Charles Lee,

    There are  not other tables that collect data for the users except of the listed above.  Note that all Generic Content items have Owner property which is stored under [sf_CmsContentBase]. If you remove any user the value of this field will not be removed.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
Register for webinar
4 posts, 1 answered