Suggest you share a little more info about your system - operating system? 'ample server' means what?
When it comes to backups and restores, Moodle uses moodledata/temp/backup/ so it might not be the location of the code folder but the location/relationship of/to the moodledata folder/directory.
What does the config.php file say for the location of the moodledata folder? (that's a question for investigation, you might not want share the specifics to that ... but in general, moodledata folder needs to be readable/writable by the web server user (on Linux/CentOS/RHEL that user is 'apache') but it shouldn't be in the document root for the web server (on typical Linux/CentOS/RHEL) that's /var/www/html
The actuall code of Moodle or the moodle folder is located in /var/www/html/ (again, CentOS/RHEL)
Have you turned on debugging to see what (if anything) is reported when a restore/backup fails?
One might get a clue by inspecting the contents of moodledata/temp/backup/
0 byte .log files indicate a successful backup or restore. A .log file of any size contains info about issues with the backup/restore. Example:
-rw-rw-rw- 1 apache apache 24406 Jun 5 17:14 972520630a2d3bf36f90098fc256354c.log
Viewing that .log file *might* show lines like the following ... remember this is an example and your .log file will say something different:
[Thu 05 Jun 2014 17:05:50 CDT] [error] (moodle1) question type converter not found dragdrop
which indicates the backup contained a quiz that had drag n drop addon question type. The Moodle to which this course was restored did NOT have a question type dragdrop thus ... issues.
Have seen the 'restore in progress' before ... it means the restore failed.
Again, check moodledata/temp/backup folder.
One might see:
-rw-rw-rw- 1 apache apache 352678102 Jun 5 17:04 c46a86109e69888092aecc1fea62f243
That's a file and it's really a .zip
One might also see a directory:
drwxrwsrwx 6 apache apache 4096 Jun 5 17:07 45ee7c330dc2374b5a0a239d6883a292
cd 45ee7c330dc2374b5a0a239d6883a292
and inspect:
[root@www 45ee7c330dc2374b5a0a239d6883a292]# ls -l
total 26036
drwxrwsrwx 588 apache apache 20480 Jun 5 17:07 activities
drwxrwsrwx 2 apache apache 4096 Jun 5 17:07 course
drwxrwsrwx 251 apache apache 4096 Jun 5 17:05 files
-rw-rw-rw- 1 apache apache 875625 Jun 5 17:07 files.xml
-rw-rw-rw- 1 apache apache 70947 Jun 5 17:07 gradebook.xml
-rw-rw-rw- 1 apache apache 57 Jun 5 17:07 groups.xml
-rw-rw-rw- 1 apache apache 371985 Jun 5 17:07 moodle_backup.xml
-rw-rw-rw- 1 apache apache 83 Jun 5 17:07 outcomes.xml
-rw-rw-rw- 1 apache apache 25237145 Jun 5 17:06 questions.xml
-rw-rw-rw- 1 apache apache 771 Jun 5 17:05 roles.xml
-rw-rw-rw- 1 apache apache 1490 Jun 5 17:07 scales.xml
drwxrwsrwx 29 apache apache 4096 Jun 5 17:05 sections
-rw-rw-rw- 1 apache apache 55 Jun 5 17:07 users.xml
Hmmmm ... rather large questions.xml file and a large files.xml file. Those need inspecting.
One might also need to check apache error logs to see if restore/backup scripts are timing out or don't have enough memory to complete the job.
Afraid there is no set/pat answer to your question. Much depends upon system, how configured, php/mysql resource limits, the backups themselvles, etc.. Been my experience that each backup/restore issue is/has been unique so it's been a sleuthing game.
'spirit of sharing', Ken