Speaking on Saturday at a ceremony in Berlin to remember victims of displacement, Gauck said he hoped that the memory of German expellees who were forced to flee the country's former eastern territories during and after World War II would deepen understanding for migrants today.
He described how 12 to 14 million Germans lost their homelands by the end of the war, leading to a population increase of 20 percent in the former West and East Germanies.
Gauck pointed out that if Germany had been able to integrate millions of refugees 70 years ago when it was "poor and devastated," it should be able to do more in the present refugee crisis, and even benefit from it.
"Why should a Germany that is economically successful and politically stable not be able to recognize future opportunities in today's challenges?" he asked.
"Let us remember what a great part refugees and forced migrants played in successfully rebuilding Germany," he added.
More European help
He also called on European Union countries to do more to help cope with the current growing wave of refugees coming to Europe.
In view of the huge number of migrants who have died attempting the perilous boat crossing from Africa to Europe over the Mediterranean, Gauck said it was a "moral duty" to save people from drowning.
"We would lose our self-respect if we left people drifting on waters near our continent to cope for themselves," he said, adding that all European states had an obligation to provide people with a safe refuge.
This obligation was "non-negotiable," and lasted until migrants either could return home without danger or had found a place to live in safety either in Germany or elsewhere, he said.
'No easy solutions'
German Interior Minister Thomas de Maiziere also spoke at the ceremony, warning that there were no "easy solutions" to the current migration crisis.
Last year, the German government declared the 20 June to be a day of remembrance for refugees and displaced people, in conjunction with the United Nations' World Refugee Day.
The German day is partly to commemorate the millions of Germans who were forced to flee their homes in several eastern European countries as a result of World War II and seek refuge in Germany and Austria, greatly swelling the populations there.
tj/sgb (AFP, dpa, KNA, epd)