Take the 2-minute tour ×
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

Could some some please help me with the steps/script to directly unpublish pages from the Tridion database, not from the CM explorer. We have a requirement to unpublish about 16000 different pages in different publication and deleting it through the CM explorer would be a huge task. Is there a way to automate this process or run a script on the database to unpublish and then delete them.

Any help is much appreciated!! thanks!!

share|improve this question
    
Consider scheduling unpublishing in smaller requests if the amount is a concern. When do you start having problems with the size of an unpublishing request? –  Alvin Reyes Feb 5 at 13:25
add comment

5 Answers

What are those pages? In Tridion 2013 you can call ICoreService2013.DecommissionPublicationTarget method which will quickly mark everything that was published with particular publication target as unpublished. You can then write a script to delete the pages through any public API.

Manipulating the database directly will give you way more troubles than you think.

share|improve this answer
    
Sorry i did not mention it earlier, I am using Tridion 5.3. Can something like this still be used in this version? –  user901 Feb 7 at 15:40
add comment

Speak to SDL Tridion support for an approved script.

Alternatively, you could write a core service / business connector script to unpublish, and then delete each page in a supported approach.

Performing this directly on the database is not supported / ever advisable.

share|improve this answer
add comment

Do this at your own risk and consider the Support/Warranty related warnings the other answers provide.

You'll need to update 2 tables in the CM DB as follows:

Update PUBLISH_STATES table:

UPDATE publish_states
SET state=0
WHERE publication_id=<your pub id>
AND item_type=64
AND state=1

Update ITEM_STATES table:

UPDATE item_states
SET state=0
WHERE publication_id=<your pub id>
AND state=1
AND publication_target_id=<your target id>
share|improve this answer
1  
This will only mark the pages as unpublished, it will NOT unpublish them. –  Nuno Linhares Feb 9 at 0:21
add comment

When you unpublish an item, it is removed from CD and published status is updated in CM. If you update the records in CM DB by directly running a script(though it is not recommended), published content in CD will become orphans and can't be removed unless you run another script to remove those published content in CD (which is again not recommended).

Building a solution using core services is the right way of getting this done.

share|improve this answer
    
the Tridion we are using is Tridion version 5.3. Can we use core services in this version? i could not find much searching online about it. –  user901 Feb 7 at 14:13
    
On Tridion 5.3 you can use the TOM or TOM.NET to accomplish the same. Going through an API is much preferred to direct database updates. –  Frank van Puffelen Feb 8 at 15:58
add comment

Directly unpublish pages from the Tridion database, not from the CM explorer

This means you know what pages and what templates are involved for unpublishing.

Best way is to create a Core Service which takes input as

  • Template type or
  • Page TCM ID or
  • Component Template TCM ID or
  • Page Template TCM ID

Get all the items which are published based on the criteria and do UnPublish.

With this, you will have full track of

  • What you are doing
  • Which items are published
  • Which items are unpublished

In future, you can this core services just like that.

Update:

Now you have mentioned that you are using Tridion R5.3. In this case, you need to write a Custom Page using Classic ASP which takes the input as I mentioned above.

share|improve this answer
    
the Tridion we are using is Tridion version 5.3. Can we use core services in this version? –  user901 Feb 7 at 12:44
    
@user901: If you are using Tridion R5.3 then you need to write Classic ASP custom page which does same as I mentioned above. –  Siva Charan Feb 8 at 11:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.