Beijing鈥檚 polarizing law, which took effect this month, upended Hong Kong鈥檚 tech scene just as it seemed on a path to becoming a regional hub. Their actions may foreshadow similar decisions from Internet giants like Facebook Inc., Alphabet Inc.鈥檚 Google, and Twitter Inc., all of which confront the same set of uncertainties.

China鈥檚 sweeping national security law has forced technology firms to reconsider their presence in Hong Kong. The nimblest among them鈥攖he city鈥檚 startups鈥攁re already moving data and people out or are devising plans to do so.

Beijing鈥檚 polarizing law, which took effect this month, upended Hong Kong鈥檚 tech scene just as it seemed on a path to becoming a regional hub. Entrepreneurs now face a wave of concern from overseas clients and suppliers about the implications of running data and internet services under the law鈥檚 new regime of vastly expanded online policing powers. Many are making contingency plans and restructuring their operations away from Hong Kong.

Their actions may foreshadow similar decisions from Internet giants like Facebook Inc., Alphabet Inc.鈥檚 Google, and Twitter Inc., all of which confront the same set of uncertainties. The larger firms are taking time to fully assess the impact of the new law, while sentiment in the city itself is dour with about half of US business people saying they plan to leave, according to a recent survey by the American Chamber of Commerce in Hong Kong.

鈥淲e are now in a dilemma. If we follow the law in Hong Kong, we may violate other countries鈥 regulations,鈥 said Ben Cheng, co-founder of software company Oursky. 鈥淲e worry that people will not trust us someday if we tell them we are a Hong Kong-based company.鈥

Twelve-year-old Oursky has already had trouble in the short period since the law came into force, with some foreign cloud service providers refusing to work with Hong Kong-based entities and reviewing the practice, Mr. Cheng said without elaborating. To circumnavigate these issues, his company will set up offices in the UK in about a year and then expand to Japan.

Tech companies that handle data are particularly vulnerable under the new law. Police can ask them to delete or restrict access to content deemed to endanger national security, with non-compliance punishable with a fine of HK$100,000 (around $13,000) and six months in prison for representatives of infringing publishers. Such provisions put technology companies under 鈥渢remendous risk and liability,鈥 said Charles Mok, a Hong Kong lawmaker. 鈥淚t鈥檚 a signal to these companies to be very careful. If you want to be safe and you don鈥檛 want the uncertainty, then maybe you have to leave Hong Kong.鈥

In recent years, the global financial center has grown into an attractive destination for fintech entrepreneurs, and its close proximity to Shenzhen and the so-called Greater Bay Area has helped foster research and development ties between startups and Chinese universities. Hong Kong had been expected to reach $1.7 billion in datacenter revenue by 2023, rivaling nearby Singapore whose server market brought in $1.4 billion last year, according to data from Structure Research. All that is now under threat.

More than half of Measurable AI鈥檚 clients are US-based. The Hong Kong firm tracks business receipts and provides transactional data to hedge funds and corporations, many of whom have expressed concern about how data trade may be affected by the Beijing law as well as Washington鈥檚 retaliatory measure of rescinding Hong Kong鈥檚 special trade status. 鈥淩ight now might be a good time for us to rethink how we can restructure or have the operations outside of Hong Kong,鈥 co-founder Heatherm Huang said, adding that the company鈥檚 accelerating plans to migrate parts of its business development and sales to Singapore and New York.

鈥淒oing a startup in Hong Kong is already difficult. It鈥檚 a super expensive city,鈥 Scott Salandy-Defour, co-founder of energy-tech startup Liquidstar, told Bloomberg News. Even before the new law, the situation in the city was fraught with US-China tensions over everything from trade to human rights. Investors have become very cautious about people and businesses with ties to China and the new law 鈥渋s like the last nail in the coffin,鈥 said the entrepreneur, who is now planning to relocate to Singapore.

One founder of an edtech venture, who like several executives interviewed asked not to be identified because of the sensitivity of the issue, said their company had transferred all its data to portable offline storage in case there was a need to leave Hong Kong in the future.

鈥淭his would be just a short-term phenomenon. I think after they understand the society is more stable, businesses will come back,鈥 said Terence Chong, an associate professor of economics at the Chinese University of Hong Kong. 鈥淗ong Kong is the gateway to China. If they want to have access to China鈥檚 market, it is the best place for them.鈥 Supporters of the law see it as a necessary step to restore investor and business confidence by curbing months of sometimes-violent unrest that have rocked the former British colony.

For some, the allure of closer integration with China through the Greater Bay Area is too good a chance to pass up. 鈥淚 think Hong Kong can still play the role it鈥檚 always played, bringing international and Chinese players in technology closer together,鈥 said Tony Verb, co-founder of GreaterBay Ventures. 鈥淚 don鈥檛 see reasons right now to run away.鈥 鈥 Bloomberg