The most space is taken by a binary data of old attachments. You should be able just to clear that data by SQL command...
UPDATE CMS_AttachmentHistory SET AttachmentBinary = NULL WHERE ... your condition to fir your needs (e.g. AttachmentLastModified < DATEADD(month, -1, GetDate()) ... for all attachments older than 1 month)
And the version history length is applied just to a new attachments, not for those which are already stored in the database. But it's good to set the limit lower to protect database size increasing in the future in this case.
If you now change the storage option from database to file system, Kentico CMS will check if the attachment exists in the file system firstly when trying to access the file. If it will not find the attachment on the file system it will try to look for this file in the database. In your case it will find the file and make copy of this file to your file system. This is done automatically after the attachment is accessed.
So, would it be possible to change the setting to file system and?
Files will be created on your file system automatically when accessing them......
If you would like to perform this operation programmatically, you can get AttachmentInfo object from each attachment and use following method:
This method will check the current storage setting and will create a copy of the file on file system from database data in case the storage option is set to file system.
So You will need to uncheck the option store files in a database. Only the option Store files in file system should be checked. Now you will need to leave the site as it is for some time. If the image is opened/updated, it will be automatically moved from database to file system.
Best regards, Martin