What is the moral of the story "the Ugly duckling"

The main point of Andersen's fairy tales is that we must steadfastly and patiently endure difficulties, hardships. The unfortunate duckling (which actually was a Swan) had to withstand a series of severe tests at the beginning of his life. He was teased and bullied rude relatives. He turned away from his own mother-duck, fearing public opinion. Then, when he escaped from the poultry-yard, and made friends with the wild geese, these geese were killed by hunters, and the duck was saved only by a miracle. After this unfortunate duckling picked up the old woman and brought to his house. But its inhabitants – the cat and the hen laughed at the new tenant and unceremoniously taught "wits". The duckling had to leave the old woman's house, the winter he spent in the reeds by the lake where the following spring he met the beautiful swans. And the tale ended in a happy outcome.

The moral of this tale is that life can be a lot of difficult trials, but we must not be discouraged and not to give up. After all, the duckling to the Swan it was very difficult, but he survived and eventually became the happy.
Similarly, people not bowing before fate, in the end, maybe to celebrate his victory.

Because of what all the trouble started duckling

The moral of the story is in the fact that it is not necessary to be afraid to be different. Duck differed in appearance from the other ducklings. That is, was not such as all. And so he began to tease and poison the ducks. Why was he unceremoniously scolded and taught the cat and the chicken? Because he didn't behave as it should. That is, again, was not such as all! The duck had a choice: or to accept what cannot be different from the others neither in appearance nor behavior, or habits, or to behave in accordance with the principle: "Yes, I'm different, but it is their right!" And he made this choice, fearing that will incur the misunderstanding, abuse and even persecution.
The person should also defend the right to be themselves, even if they have to go against public opinion.

Some experts on the work of Andersen think that the way the ugly duckling, the author of the tales depicted it themselves. Because Andersen also had to endure a lot of ridicule, misunderstanding and arrogant teachings from other people , before he became a famous writer, and his appearance is very different from the image of the average Dane. Never give up, fight for their happiness despite all obstacles.