A "root canal" was an engineering slang term used to describe a rebuilding of a computer or other systems software from the ground up. It was usually performed when the system was considered to be beyond conventional repair.
Miles O'Brien, who was distinctly unimpressed with Cardassian technology, wanted to perform a root canal on the Cardassian-built computers on Deep Space 9. Given his inexperience with Cardassian technology, he claimed it would take two to three years. (DS9: "The Forsaken")