Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fergus Davidson 309 posts 588 karma points
    Jun 01, 2010 @ 20:58
    Fergus Davidson
    0

    PLEASE HELP uninstalled Goggle Analytics package in use

    hi

    we have a site installation and i inadvertantly unistalled the google analytics package, the datatype of which is in use in several documents.

    those documents wioll ow not load - what can i do?

    is there any way i can reinstate the package and datatypes or remove the references to them??

     

    Please help 

  • Fergus Davidson 309 posts 588 karma points
    Jun 01, 2010 @ 21:00
    Fergus Davidson
    0

    can i loop through all nodes and doctypes removeing the field or tab?

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jun 01, 2010 @ 21:17
    Matt Brailsford
    0

    Couldn't you just reinstall the pacakage?

    Matt

  • Fergus Davidson 309 posts 588 karma points
    Jun 01, 2010 @ 22:09
    Fergus Davidson
    0

    no, i don't think so. i had used the datatype in some documents and now i get:

    No node exists with id '10351'

     

    on all those doctypes

  • Lee Kelleher 4024 posts 15833 karma points MVP 13x admin c-trib
    Jun 01, 2010 @ 22:49
    Lee Kelleher
    1

    Yikes! To tell you the truth, it sounds painfully messy!

    Even if a re-install was successful, the IDs in the cmsPropertyType table would be wrong - hence the "No node exists with id ...".

    I do have a suggestion... I haven't tried this myself - so no guarantees!  Depending on how comfortable you are with SQL, here is a suggestion.

    Remember to back-up your database first!!!

     

    First, get the nodeId of the document-type.  Either hover over it in the back-office GUI, or do it in SQL:

    SELECT nodeId FROM cmsContentType WHERE alias = 'ContentPage'

    Then take that nodeId to get the list of properties for that document-type:

    SELECT * FROM cmsPropertyType WHERE contentTypeId = 1234

    In the recordset you should see a reference to the property for the Google Analytics data-type (the one with the nodeId of "10351").

    Delete that row.  Now try to view the document-type in the back-office GUI ... hopefully it will load.

    The downside is that there will be orphaned rows in the cmsPropertyData table ... depending on how many content/document nodes you have, try something like this:

    SELECT * FROM cmsPropertyData WHERE propertytypeid = 10351

     

    Like I say its a long shot... so if you aren't comfortable with SQL and/or playing with the database, don't do it.

    Good luck, Lee.

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jun 01, 2010 @ 23:03
    Matt Brailsford
    1

    Hmmmm, I may have some SQL scripts that may be of use, as this is effectivley what my master doc type switcher project does (Swapping one data type to another of the same type).

    If you've not solved it, I'll try and pull them out tomorrow morning.

    Matt

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jun 02, 2010 @ 10:01
    Matt Brailsford
    2

    Ok, here is what I've come up with.

    First off, backup your database before you try any of this. 

    Now, If you want google analytics back, reinstall the google analytics package, then in your DB run the following SQL, to find the new id of the data type

    SELECT  dt.nodeId
    FROM cmsDataType dt
    inner join umbracoNode n on n.id = dt.nodeId
    WHERE n.[text] = 'INSERT_DATA_TYPE_NAME_HERE'

    This should give you the new node ID of the data type, then you should be able to run this statement to convert your old properties (Don't forget to change the placeholder NEW_ID to the new id from statement 1, and OLD_ID to the old data type id):

    UPDATE cmsPropertyType
    SET  dataTypeId = NEW_ID
    WHERE pt.dataTypeId = OLD_ID

    If you want to get rid of the old data, you should be able to run the following statements:

    DELETE
    FROM cmsContentVersion
    WHERE id in (
            SELECT cv.id
            FROM cmsContentVersion cv
            inner join cmsPropertyData pd on pd.versionId = cv.VersionId
            inner join cmsPropertyType pt on pt.id = pd.propertytypeid
            WHERE pt.dataTypeId = OLD_ID
            )
    DELETE
    FROM cmsPropertyData
    WHERE id in (
            SELECT pd.id
            FROM cmsPropertyData pd
            inner join cmsPropertyType pt on pt.id = pd.propertytypeid
            WHERE pt.dataTypeId = OLD_ID
            )

    This should then remove all data for that data type, and all properties which use that datatype.

    (NB This is assuming that the properties were page properties. You may need different statements if you had macro properties)

    I hope this helps.

    Many thanks

    Matt

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jun 02, 2010 @ 10:12
    Matt Brailsford
    0

    Oops, missed a final delete statement. Run this last as part of the "if you want to delete the old data" sequence.

    DELETE
    FROM cmsPropertyType
    WHERE dataTypeId = OLD_ID

    Many thanks

    Matt

  • Fergus Davidson 309 posts 588 karma points
    Jun 02, 2010 @ 12:04
    Fergus Davidson
    0

    thanks so much Matt

    out of desperation last night i had got the first part done, converting the datatype to textstring.

    all seems well.

    i was at a bit of a loss as to how to cleanse the orphaned references, so i will try your last bits later.

     

    again, many thanks.

     

    lesson learned: never touch the backend when too tired, never uninstall packages without having a sleep beforehand :)

Please Sign in or register to post replies

Write your reply to:

Draft