Code:
You may need to adjust the batch size if you get governor limit errors while executing this code. Also, this code ignores errors, so you'll need to check the results after processing.
How to Run Batch Class :
1) Go to Setup ---> Open Developer Console.
2) Select "Debug" tab ---> Open Execute Anonymous Window (OR press Ctrl+E )
3) In this window, type
Database.executeBatch(new MyClass());
Please make sure to replace MyClass with the apex batch class name that you have written/ want to execute.
Example : Database.executeBatch(new ConvertAllLeads(),1);