How to copy a layer group to another image in GIMP?
In GIMP I have 2 images with exact same size and properties but different layers. Now I have a relatively large layer group, which I would like to copy to the other image. As usual I copy and paste it. Now it is a floating selection. As suggested in the docs, I click to anchor the floating selection. However, after clicking "anchor", floating selection disappears.
Is my GIMP has a bug or am I doing something wrong here?
Correction: I can copy a layer group but it comes flattened/merged as one single layer. I do want to keep it as a layer group.
Copy&paste is the wrong approach to copy layers from one image to another - this will only transfer the layer content, and as you have discovered that isn't the same as a layer or group of layers.
Instead, drag the layer or layer group from the layers dialog of the source image to an image window of the target image. This will keep them intact, including any possible layer parasites (this is important for text layers, for example).
Save the original image with the layer group as an xcf. In the new image, and open the original as layers (
File > Open as Layers). This will add all of the layers from the original image.
You'll need to delete the layers from the new image that you don't want. Unfortunately you can't pick/choose what layers you import. But as long as this is only a one-time transfer (i.e. you don't need to copy/paste the layer group back and forth) this should work.
EDIT: This was tested in GIMP 2.8.4. Michael's answer is a better way, if you are using a version of GIMP that supports it.