This is "With Friends Like These..." (1971) by Alan Dean Foster, anthologized in the collection of the same name.
The galactic confederation is fighting the Yop, who are inimical to all other life:
...the Yop policy of regarding all those peoples, who were not allies of the Yop, as mortal enemies of the Yop. There was room in neither Yop culture, nor Yop language, for the concept of a "neutral." Yop temperament was such that their total complement of allies came to a grand total of zero.
Earth had once fought a previous galatic empire almost to a standoff:
...the Shield is the direct result of the Old Empire-Terran Wars of ages ago. At that time, the inhabitants of this planet first broke free of their own system and started to come out to the stars.
"They found there a multiracial empire nominally ruled by a race known to us as the Veen. The Terrans were invited to join the empire, accruing the same rights and privileges as had historically been granted to all new space-going races for thousands and thousands of years."
"And they refused," put in Rappan. "Yes, they refused. It became quickly apparent to the Veen that the Terrans intended to carve out a little pocket empire of their own in another sector of space. Since Terra was so far away from the center of things, so to speak, the Veen decided that for the sake of peace--and the Veen--this could not be allowed to take place. Accordingly, there was a war, or rather, a series of wars. These lasted for centuries, despite the overwhelming numerical superiority of the Veen. Gradually, the Terrans were pushed back to their own home world. A standoff ensued, as the Veen and their allies were unable to break the ultimate defenses of the Terrans.
"Then a great scientist of one of the allied races of the Veen discovered, quite by accident, the quasi-mathematical principle behind the Shield. The nature of the Shield forbade its use on anything smaller than a good-sized moon. It was thus useless for such obvious military applications as, for example, a ship defensive screen. Then someone got the bright idea of enveloping the entire planet of Terra in one huge Shield, making it into an impenetrable cage.
The Earth they find is pastoral:
Green, thought Phrnnx. It is the greenest nontropical planet I have ever seen.
He was standing by the end of the ramp which led out from the belly of the cruiser. The rest of the First Contact party was nearby. They had landed near a great mountain range, in a lush section of foothills and gently rolling green. Tall growths of brown and emerald dominated two sides of the view. In front of them stretched low hillocks covered with what was obviously cultivated vegetation.
Earth does indeed require that the Shield be dropped:
"Of course," continued the Terran after a while, "as a gesture of your goodwill we would naturally expect you to lower the Shield."
And they do follow with the entire planet Earth, bringing the Moon along too:
"Sir," began Zinin to the commander, and his great voice was strangely muffled, "they're coming ... in their ship, like they said they would."
Phrnnx yanked himself back to reality--if such it still could be called--and joined the others who were now occupied at the fore port.
Below, great masses of puffy white clouds. Brown and green land masses, unchanged. Blue oceans, unchanged.
In the middle of the planet's second ocean, great, impossible masses of thick columnar crystals began to leap upward from the waters. Translucent at first, the chalcedony towers began to pulse with deep inner fires: blue, purple, gold, carmine, and finally a strange, yet familiar silver-gray. The ionosphere, tickled, began to surround the flashing needles with auroras, clothing them in blankets of coruscating radiance.
Following, the planet began to move after the Tpin.
On board the cruiser it was very quiet.
"I see," whispered Rappan idly, "that they are bringing their moon along also."
"You get accustomed to something like that," breathed an engineer. "A moon, I mean."