I have a 7.1.4 site that has ended up with alot of nodes. So many that the backoffice is too heavy and in some cases even unusable.
It takes alot of time for the client to get ready to delete those nodes - before which I get a "the wait operation timed out" error. But it would take too long to delete then all by hand one-by-one (and I'd still need to delete them from the recycle bin), and it seems impossible to delete the parent node as there are simply too many child nodes.
So, how do I delete these nodes through SQL? I have the ID of the parent node and all the nodes are of the same document type, not used anywhere else. I don't need them to go to the recycle bin they just need to be gone.
I'll investigate what options I have in regards to the optimization solution. I'ts a hosted site but I might get the appropriate assistence from the admins :)
I had already ruled the other link out precisely for the reason that it's definitely not for v7. I'm pretty sure too many things have changed in the database structure for me to dare try that solution :)
The funny thing is this strange behavior. In order to delete some of these nodes, I have to wait. I just go ahead and try to delete one, wait for the "operation timed out" error to appear, close it, wait about five minutes, klik the ok-button again to see if it's ready, if not I wait again, otherwise it's deleted quite fast and I can delete one-by-one without further trouble. Trying to delete the parent node at this stage will result in the "operation timed out" error - but I left things standing over night, and if I try to delete the parent now, that error doesn't appear. In stead I get an error telling me that the transaction log is full. Even after I've had it cleared. So I'm not totally sure it's a database thing.
But if it turns out that the transaction log would be filled whenever I try to delete the parent, it would be nice with some SQL to do the work - at least I woul be able take delete a bigger chunk at a time but still be able to restrict the amount via the dates (I'd think)
Don't know if it would also be possible to try and do an upgrade and see if it's a version specific issue? Do you have an estimate about how many nodes we're talking about? Could perhaps also be a hosting issue?
What is the reason you need to get rid of them? Could an option be to migrate the solution to a fresh installation instead and then re-create the content that still needs to be there?
It's robot-spam comments on a blog that got in before we had a chance to introduce some captcha... And they make it impossible for the client to actually use Umbraco, not able to create new nodes, neither in content nor media. Migrating to a fresh install would be a last resort.
You can use the Bulkmanager I wrote for this http://soetemansoftware.nl/bulkmanager It's a commercial product but free for deleting content. And you can delete in batches instead of deleting all at once.
7.1.4: Delete child nodes through SQL
I have a 7.1.4 site that has ended up with alot of nodes. So many that the backoffice is too heavy and in some cases even unusable.
It takes alot of time for the client to get ready to delete those nodes - before which I get a "the wait operation timed out" error. But it would take too long to delete then all by hand one-by-one (and I'd still need to delete them from the recycle bin), and it seems impossible to delete the parent node as there are simply too many child nodes.
So, how do I delete these nodes through SQL? I have the ID of the parent node and all the nodes are of the same document type, not used anywhere else. I don't need them to go to the recycle bin they just need to be gone.
Thanks
Hi Bruno
I'm not sure there is a ready made solution for bulk deleting nodes from Umbraco 7.
However I'm wondering if it would be an option to optimize/add database indexes to speed up the site so nodes can be deleted manually?
I once had a site that was becoming reeeeally slow so I asked this question http://our.umbraco.org/forum/developers/extending-umbraco/42361-This-is-a-bit-dirtybut-I-need-to-mess-with-the-database - Look at the answers from Mikkel as he's actually providing the real solution.
If that works and speeds up the site perhaps the site won't timeout when you're trying to delete parents with many children.
Otherwise you could perhaps find some inspiration here http://our.umbraco.org/forum/developers/api-questions/19620-delete-nodes-from-database - But please note that this post is from 2011 and a lot has happened with Umbraco since. I don't know how many db structure changes that has been made since.
Hope this helps.
/Jan
Hi Jan
I'll investigate what options I have in regards to the optimization solution. I'ts a hosted site but I might get the appropriate assistence from the admins :)
I had already ruled the other link out precisely for the reason that it's definitely not for v7. I'm pretty sure too many things have changed in the database structure for me to dare try that solution :)
The funny thing is this strange behavior. In order to delete some of these nodes, I have to wait. I just go ahead and try to delete one, wait for the "operation timed out" error to appear, close it, wait about five minutes, klik the ok-button again to see if it's ready, if not I wait again, otherwise it's deleted quite fast and I can delete one-by-one without further trouble. Trying to delete the parent node at this stage will result in the "operation timed out" error - but I left things standing over night, and if I try to delete the parent now, that error doesn't appear. In stead I get an error telling me that the transaction log is full. Even after I've had it cleared. So I'm not totally sure it's a database thing.
But if it turns out that the transaction log would be filled whenever I try to delete the parent, it would be nice with some SQL to do the work - at least I woul be able take delete a bigger chunk at a time but still be able to restrict the amount via the dates (I'd think)
/Bruno
Hi Bruno
What database is being used btw?
Don't know if it would also be possible to try and do an upgrade and see if it's a version specific issue? Do you have an estimate about how many nodes we're talking about? Could perhaps also be a hosting issue?
Cheers, Jan
Hi Jan
It's a MS SQL database, unfortunately I can't tell which version it is, and I only have a web interface for it.
There are more than 7000 child nodes, in each of three parent nodes, so all in all I need to get rid of more than 20000 nodes.
/Bruno
Hi Bruno
Holy Moly....that was quite a lot of nodes.
What is the reason you need to get rid of them? Could an option be to migrate the solution to a fresh installation instead and then re-create the content that still needs to be there?
/Jan
Hi Jan
It's robot-spam comments on a blog that got in before we had a chance to introduce some captcha... And they make it impossible for the client to actually use Umbraco, not able to create new nodes, neither in content nor media. Migrating to a fresh install would be a last resort.
/Bruno
Hi Bruno,
You can use the Bulkmanager I wrote for this http://soetemansoftware.nl/bulkmanager It's a commercial product but free for deleting content. And you can delete in batches instead of deleting all at once.
Hope this helps,
Richard
Hey Richard, was curious if this is now discontinued? I'm getting exceptions on 7.5.11.
Cheers!
Hi Richard
Thank you for letting me know about this. I'll have a look at it and let you know if it worked out :)
/Bruno
Hi Richard
Thank you so much. It worked like a charm :) All spam-nodes are gone now.
/Bruno
Great to hear spread the word :)
Hi What is teh exception you get? Should just work..
Best,
Richard
is working on a reply...