by Tim Hunt.
The answer should be yes. What you are doing is essentially https://docs.moodle.org/28/en/Moodle_migration
Probably best to start with exactly the same version of the Moodle code if you can. One less thing to go wrong. Once everything is working again, then upgrading would be recommended.
If you look at the Moodle downloadURL, it should be obvious how to download any previous version.