You need to actually install the gallery on the test domain to integrate with the new test install you have.
The config files only have the basic config elements of the install. All the url and path statements are in the database settings table.
This should assist you as this is the sticky posted at the top of this very forum your posting in.
How to Move Servers and/or Change Directories