Question: In the year 2500, the main planets are all colonised for various reasons (Mars as another place to put the population, Mercury for minerals, etc.). The planet Mercury then becomes more and more rich, until its ruler declares himself emperor. 

In the year 2900, a war starts, lasting until 3000. At the end, people have been reduced to almost stone-age technology. My question is this: how would someone attack in a way that the people survive, while knowledge disappears.

Answer: 
This is a tricky proposition. Firstly, if planets like Mars and Mercury are inhabited and settled there needs to be a high level of environmental and life support technology in place. Remove that and everybody dies. However, it is a requirement of the OP that they remain alive. Not entirely impossible, but it will be necessary to come back to it.

After one century of warfare, everyone is reduced to almost stone-age technology. So their knowledge has disappeared. Now how to pull these threads together?

Assume highly automated technology, so highly automated, self-regulating, self-maintaining, and self-repairing that it's been centuries since humans had to do anything with their technology. No-one needs to be trained to be an engineer, repair person or anything technologically oriented.

So a century ago, the war begins. It starts with a phase of cyber warfare that prevents humans from controlling their machines. Just say "Open the pod bay doors, please HAL." To find nothing happens. Humans find their access to the knowledge about how their technology works is also locked up. Totally inaccessible. Now they are completely knowledge deprived. Previously this is knowledge they didn't need as the combination of AI and cybernetic control systems mean the machines could take care of themselves

Humans can survive. They live on inside their life support and habitat facilities on planets like Mars and Mercury. They are reduced to what is effectively a hunter-gatherer lifestyle. Hunting what had been previously livestock and zoological specimens. Gathering edible plants from what had been parks and gardens. They have learned how to make primitive stone tools.

This does mean by 2500 human habitats were gigantic structures occupying spaces, that collectively, would be size of small nation states. Life support and environmental systems keep humans alive inside their habitats on the settled planets of the solar system, but humans are forced live their lives as palaeolithic savages.
Depends on the level of technology. For simpler technologies you cannot get rid of them without killing people. People will remember and pass on. For high tech, destroy the infrastructure and do not allow them to rebuild it for a while. Additionally, destroy libraries and wipe out digital devices using EMP. This will send them back to late 1800s. Without advanced machinery, knowing how to make 22nm transistor will not help anyone. Over time, people will switch to a more primitive technological level and will start building slowly. Not having books means not having head start as most primitive technology will not be known to the people. With war running 100 years, most people with the knowledge of the advanced machinery will die of old age. Even if they manage to get back into advanced age, they again will not have any head start to rebuild. Then these people will slowly advance like we did in the past.