Mushroom - here's a bit of historical irony for you -
illegal immigration was a problem in both Spanish AND Mexican California!
Outsiders jumped ship and fled into the hills, often marrying local girls to make their presence legal. And, more than a few trappers came over the mountains into the Central Valley seeking beaver and other furs, even sneaking to the coast to trap sea otters - the creature that caused concerns over the Russians in the first place!
As long as they convinced the padres to baptize them into the Catholic church, they were instantly considered legal.
However, when Mexico took control, foreigners paid for "passports" allowing them to say for 1 year at a time. They could then marry a local girl of good standing and apply for naturalization.
Tell me about it!
And in the Territory and State of California during the Gold Rush it was even worse.
Huge parts of the city of San Francisco are built on top of the old waterfront. Once gold was discovered often entire crews would jump ship and head to the hills to make their fortune. And because more land was needed the abandoned ships were just filled with rocks and dirt and trash and sunk to the bottom, expanding the city. The outer mile or more of the East side of the city is all built upon the hulls of abandoned ships from all over the world.
San Francisco got huge "immigrant districts" within less then 10 years. German, Italian, Chinese, each settled their own little areas which remain to this day.
And how much area was filled in with all these abandoned ships full of illegal immigrants?
One of my favorite old maps, from 1852. If you are familiar with the city, the map is turned 90 degrees to the right, turn left and you will recognize it.
Notice the darker areas of the street grid, that is all fill, new land made within the previous 3 years. I actually work at the corner of Washington and Montgomery, the top of that little bay in the bottom center. They kept going out for quite a while even after this map was made, you can't even see Embarcadero yet, it was still underwater.
This should give you an idea how many ships were abandoned in this city in the late 1840's and early 1850's.
Most of the crews were "illegal aliens".