Yes, there is a specific routine for this to happen and make it work as it should. You have not used this routine which is why it is not working.
Moodle is broken into three part, on its own, no part works, but all together, they make up your Moodle.
1. The code. This is what drives the Moodle. It lives in the \moodle folder on your site - by default, but you might have called it sometihng else.
2. The database. Depending on your database, say it is MySQL, the data is placed into a database specifically created for your site and it does not necessarily live in the Moodle folder, where the code is, or even on the same domain. It can be where ever the server has MySQL setup to create new databases, or in another folder on a separate drive.
3. The \moodledata folder. This lives in the domain, but on the same level as the \moodle folder. This contains the files and other materials for each course, even if not recognizable.
To make a backup like what you describe work, it needs all three parts, and I doubt you have them.
What you have downloaded, I suspect, is the code and perhaps the \moodledata folder. Without the data in the database, it will not work - it needs all three parts to work.
Your server might have as a tool phpMyAdmin, or similar, which allows you to backup your database as a *.sql file, which allows you to restore it to an empty MySQL database. If you use another database, then there will be a similar tool for that, and if you have all 3 parts, it will work when you restore to the site.
You can use the same backups to your local machine, if you change the address in the config.php, have a copy of the DBMS and make sure they are linking to the local machine and you can copy the \moodledata folder.