Magento – Out of stock item not changing even the quantity is greater the 0

ce-1.9.0.1statusstock

I have version 1.9 loaded the problem is, I update the stock via csv file. When the item goes 0 it change to "out of stock" but when the quantity increase greater then 0 it doesn't change back to "in stock". It still says quantity 29 "out of stock" and all out of stock items do not show on our front end. so I am losing customers on item which I actually have in stock.
I have over 50000 items so can not change everything manually.

Any idea how can I resolve this issue please? Magento should change the status automatically when quantity become greater than 0.

Best Answer

You have to change the status for each product.

The good thing is that it has been done before:

How to set a product to be in/out of stock programatically

You have to loop through your products and apply the snippet in the above link.