Fórumok

Delete all blog entries in a community?

thumbnail
Aaron Paxson, módosítva 12 év-val korábban

Delete all blog entries in a community?

Regular Member Bejegyzések: 102 Csatlakozás dátuma: 2010.07.28. Legújabb bejegyzések
How can I delete all blog entries in a community? I've imported my blog from Wordpress, but the comments did not seem to come over. I'd like to do it again. How do I delete my existing entries 150+ so that I can do it again?

Is it easy? Maybe just a SQL delete?

Thanks!
thumbnail
Ryan Park, módosítva 12 év-val korábban

RE: Delete all blog entries in a community? (Válasz)

Regular Member Bejegyzések: 120 Csatlakozás dátuma: 2007.08.28. Legújabb bejegyzések
Hi Aaron,

May I first advise NOT to do a SQL delete. Creating a Blog Entry also creates items in other tables and doing a SQL delete will cause them to become out of sync.

Unfortunately there isn't a button that will delete them all for you but using Server Administration scripts we can accomplish the same.

1. First go to Control Panel > Communities, and click on the community of the blog entries you'd like to delete.
2. Write down the its ID.
3. Now Go to the Control Panel > Portal Administration > Script
4. Copy and paste the below code and where ##### is the ID of the site you'd like to rid of Blog entries.
Packages.com.liferay.portlet.blogs.service.BlogsEntryLocalServiceUtil.deleteEntries(#####);

5. Execute.

That should be it.
thumbnail
Aaron Paxson, módosítva 12 év-val korábban

RE: Delete all blog entries in a community?

Regular Member Bejegyzések: 102 Csatlakozás dátuma: 2010.07.28. Legújabb bejegyzések
Heh. Ummm..... Ooops. Being as impatient as I am, I did go ahead and do a SQL delete. I hope I didn't do too much damage. My SQL was:

delete from BlogsEntry where companyId=11404;

I will definately keep that in mind next time. Again, hopefully, I don't have any orphaned entries. So far, I haven't noticed anything. Thanks for the response!!
thumbnail
Ryan Park, módosítva 12 év-val korábban

RE: Delete all blog entries in a community?

Regular Member Bejegyzések: 120 Csatlakozás dátuma: 2007.08.28. Legújabb bejegyzések
Hi Aaron,

You may have some issues that will crop up.

The easiest one I can think of is that the Social Activity will still show for those deleted items and will have a link to them. Those links are likely to be broken. If you can at all restore your DB and use the Admin Script I think you will be better off.

Other than that Good Luck with you installation.
-Ryan