Buses and trains can connect you from San Diego to San Francisco, although they're much slower than flying (which is summarized on the previous page). They'll take about 50% longer than driving by the fastest route.
San Diego to San Francisco by Bus
Greyhound buses run from San Diego to Los Angeles. Expect many stops along the way, each one lasting 10 minutes to an hour. The fastest time is slightly more than 11 hours and fares are somewhat less than flying.
Once you get to Los Angeles, you'll have more options, including a couple of luxury buses. They're described here.
San Diego to San Francisco by Train
The Amtrak Pacific Surfliner goes from San Diego's Santa Fe Depot through Los Angeles and north, but not quite all the way into the city of San Francisco. Instead, the trains go to Oakland, which is across the bay from San Francisco. If you choose this route, Amtrak will take you from Oakland to San Francisco in a bus. A more convenient option might be to get off Amtrak at the downtown San Jose station, where you can catch CalTrain which goes directly to San Francisco.
It takes slightly more than 12 hours by train to get from San Diego to San Francisco and it costs about the same as a bus.