how were they able to open inter-planet portals? Has it happened before?
In Doctor Strange (2016), Mordo clearly states that the ring is used to travel throughout the multiverse.
Mastery of the sling ring is essential to the mystic arts. They allow us to travel throughout the multiverse.
So, yes it is possible.
how did they know where to open the portal and look for the help?
Most probably Doctor Strange knew the locations.
Doctor Strange had seen most of the scenarios of the war against Thanos -- around 14 million -- including the one that was shown in Avengers: Infinity War.
So, he would be having some idea about locations of the battles when they got wiped out in Avengers: Infinity War as he had seen this scenario. After coming back from dust, Dr Strange would have felt that he came back from a deep sleep but will be having perfect memory of what was going on before he became dust.
He just needed to open the portals at those probable locations. And he would have led the sorcerers to those locations.
Based on Frank's comment:
Strange seems to come directly from the planet they got dusted on, so one can speculate that he would have stuck his head through some portal, told Wang and co. where to go. It would require him to transfer knowledge of the places.
We can see that from the conversation between Strange and Wang which implies that he sent him to collect the rest.
Strange would have brought the guys from his planet (where he got dusted) to Avengers Headquarters (where the battle is) and would have had his mages do the other portals.