About two years ago, Melissa Palmer, CEO of a company called Hoopnotica, made a shocking discovery. Chinese factories were producing knockoffs of her company's $50 travel Hula-Hoops and selling them on Alibaba and other international wholesale websites on the cheap. Palmer, a partner in the $1.5 million Venice, California-based company, sent cease-and-desist letters to the sites, with little success. "It's infuriating," she says.

When Palmer was unable to find a U.S. factory to produce the hoops, a business associate recommended a facility in Mexicali, a Mexican border town just a three-hour drive from Venice. "I made the mistake of not going to China to take action faster," Palmer says. "Now I can zip down to the factory in a day."

Mexico's share of the U.S. import market has risen to an all-time high of 14.4%.

Hoopnotica is one of the growing number of U.S. businesses bringing manufacturing back to the U.S. or "near-sourcing" it to Mexico. The country has been losing manufacturing to China for years. But things are changing now that the value of the Chinese yuan is rising, the cost of overseas shipping has surged, and increased competition among Chinese factories has resulted in labor shortages and longer lead times.

Thanks to the North American Free Trade Agreement, goods imported from Mexico can enter duty free. Mexico also has a strong reputation for protecting intellectual property, a valuable advantage over China. Still, Mexico is no Michigan. Here are some factors to consider before moving production there.

Costs Might Be The Same

Mexico's wages are 40 percent higher than China's, at about $3.50 an hour. As a result, overall production costs are comparable in the countries, once you factor in Mexico's lower transport and customs cost. But Chinese factory wages are climbing 14 percent annually. Michael Zinser, a partner at Boston Consulting Group, expects them to be 25 percent higher than Mexico's in five years.

Slower Is Better

Many companies make the mistake of moving all of their production to Mexico at once to start reaping the benefits, says Scott Stanley, senior vice president of NAPS, a San Diego company that helps businesses set up production in Mexico. Instead, Stanley advises clients to begin by producing simple items at a new facility, then gradually introduce new lines. By doing so, you will minimize initial risks, he says. You'll also be able to work out production kinks one product line at a time, avoiding major business disruptions.

Yes, You'll Need Guards

Starting in 2009, Mexico showed gains in 20 of the 26 manufacturing import categories in the United States, including telecommunications, electronics, and transportation.

Security is a concern in Mexico, especially near the U.S. border, where carjackings and highway robberies are common. The U.S. State Department urges travelers to exercise caution when visiting the northern cities of Mexicali and Tijuana, which are major manufacturing hubs, and to defer nonessential travel to more dangerous cities, including Juarez. To stay safe, look for factories in industrial parks with security guards, Stanley says.

Don't Forget Mom

Paying attention to local customs can go a long way. For instance, Mother's Day is a major holiday in Mexico, says Stanley, who encourages companies opening factories there to hold a party for employees and their mothers to honor the day. He also suggests paying homage to soccer by setting up a foosball table in the break room. Just think of it as Silicon Valley South.