Developer Forum »
Deleting culture
58 posts

What is the recommended order of steps to delete a culture?

I was thinking along the lines of:

- delete all rows from the database belonging to the lcid, and also all rows in all tables with culture_id field
- remove the culture from ontology (rebuild?)
- update all remaining contents to derived = false

Anything I'm missing?

120 posts

Follow these steps:

  • Take a site backup
  • Upgrade to latest Webnodes version
  • Remove language from the Ontology module
  • Perform a "Full Rebuild" in the Ontology module
  • Check that the site working as you wanted, without the language
  • Run "Delete unreferenced records" under "Database" in the System module (This will take some time on larger websites)
  • Ole

     

    58 posts

    Ok, thanks! :) I'll let you know how things move along!

    0 posts
    Relatude

    Btw.. this is an old Webforms (Website) project. Are there any things I should consider for the upgrade? Anything different from the upgrade guide?

    120 posts

    No, type of Visual Studio project makes no difference.

    (The Webnodes upgrade is probably needed to get the "Delete unreferenced records" function )

    58 posts

    Ok, went through the upgrade and went ahead to delete all unreferenced records. I managed to delete almost half of all content, but the number of records have only dropped by ~600k db rows. I had to run the process without inner contents. otherwise, it just stops (see attached image).

     

    EDIT: I let the job continue, and after some 15 minutes or so, it started again, so hopefully it will finish!

    58 posts

    Hmmm.. the delete operation finished now, but still only 1000k rows have been deleted from the database. There were 1,1m nodes, and now there are 550k. But I still have 4m+ rows in the database? Shouldn't this number be lower?

    120 posts

    If you only have one language left, there should only be one row for each available revision in the "native_content" table. If each node only has one revision the number of nodes and rows should be the same. Which table are you looking at?

    58 posts

    I am only referring to the total count in the system panel in edit. I will check that table manually.

    58 posts

    The number of nodes corresponds to the actual number of rows in native_content, and the rowcount for the whole database also corresponds to the actual number of rows in the entire database. I used this query:

    CREATE TABLE #counts
    (
        table_name varchar(255),
        row_count int
    )
    
    EXEC sp_MSForEachTable @command1='INSERT #counts (table_name, row_count) SELECT ''?'', COUNT(*) FROM ?'
    SELECT SUM(row_count) AS total_row_count FROM #counts

    This means that each and every node has a row in roughly 8 tables? (~500k nodes, ~4000k rows). Almost all the content only has a class hierarchy (from ContentBase) of 5 levels or shallower.
    120 posts

    That number is approximate, and might take some time before it updates, especially on larger databases. (This is to avoid heavy SQLs in the backrground, COUNT can be a heavy statement and may cause timeouts). Check directly in the DB.

    1