Set Sitecore.Configuration.Settings.Indexing.Enabled = false before the process starts and then turn it back on at the end.