Question: I am currently announcing 8 /24 Subnets over BGP. I am planning to move our servers to a other datacenter, but i want to keep all IPs.

Is it possible that i announce the prefixes on 2 locations and tell that traffic from IP 1.1.1.1 should go to location A and traffic from IP 1.1.1.2 should go to location B?

There is no direct connection between the 2 datacenters, no traffic exchanger is possible. 

Location A isnt stable, there are nearly everyday network problems. Location B is stable and should not get disturbed because of location A.

I know i can announce the prefix on multiple locations, but then the shorter path will be used. I need a way to tell other routers that the IP X is on location A and IP Y is on location B. 

What would be the best way to perform this using BGP?

Answer: 
Possible script:

1. Move every /24 prefix in BGP one at a time.
2. Before moving the first /24 prefix, establish an IP tunnel between the two locations.
3. When you need to move one IP of a given /24 prefix, make location A to forward that address (a /32 route) thru the tunnel to location B.
4. As soon as every address from one /24 prefix is going to location B via tunnel, move its BGP prefix announcement from location A to B.
5. Repeat steps 3-4 for every /24 prefix.
6. Bring down the tunnel.
If both sites use the same ISP, and the ISP's AS is the same at both sites, this may be possible. You could work with the ISP to announce to it some `/32` addresses on a temporary basis. The ISP's AS would still announce to the Internet that it has your `/24`, but it can route longer prefixes internally. This is not something that you can just assume the ISP will do, but *some* ISPs may accommodate such things from time to time. An ISP typically will not help you at all to move to a different ISP.