The simplest way to do this is:
Step 1) On test server install GP 2013 and launch GP Utilities. Let it create the DYNAMICS database and other basic SQL tasks.Do not create the lesson company.
Step 2) Once Utiilities is completed, drop the DYNAMICS database using SSMS
Step 3) Detach the databases from your production server and copy them to the test server
Step 4) Attach them to the test server and return to the production server as attached them as well.
Step 5) Launch GP Utitlities. This will then proceed with the upgrade.
Make sure you have installed all the modules and third party products on the test server as on the production server.
You can also run the capture login scripts to restore the users on the test server, if needed.
As mentioned before KB 878449 will provide complete instructions.