Q:

Why were penal colony members from Australia moved to San Francisco in 1840's?

The Wikipedia article about San Francisco's Barbary Coast old red light district says, under the heading "Sidney Town":

By the end of 1849, several ships from Australia brought former
  members of Great Britain’s penal colony – including ex-convicts,
  ticket-of-leave men, and criminals – to San Francisco, where they
  would become known as the Sydney Ducks. These Australian immigrants
  had become so numerous that they dominated the neighborhood. They
  opened boarding houses and various types of groggeries which had
  prostitutes affiliated with their businesses.

These individuals had originally been taken to Australia as part of the British penal transportation mechanism that was operated from 1788 to 1868, described in this Wikipedia article.
The question I would like to ask:
Why were these ex-convicts, ticket-of-leave men, and criminals moved from Australia to San Francisco?

A:

Transportation to Australia (as the criminal sentence was labelled) was not necessarily for life (although, the cost of returning to Britain essentially made it so). Many crimes that afforded a sentence of Transportation would seem to be quite petty by today's standards (stealing a loaf of bread, for example, or even just being in debt) - and the court/magistrate would state a period of service after which the transported convict would become a free person again.
So, your bread-stealer might get 5 or 7 years transportation, for example, and as long as they worked in the colony and kept out of any other trouble, they would become a free man at the end of the period. Quite a few ex-convicts eventually become important businessmen and leaders in government - some return to Britain, and others moved on elsewhere.
The wiki article makes it sound like there was simply a mass exodus in one fleet from Australia to San Francisco - but more likely, this happened over a period of time as ships with trade goods arrived from Australia with freed transportees looking to get away from the colony. As for why they would want to move to San Francisco - the 1840s was the gold rush period.

