Index: restore.php
===================================================================
--- restore.php	(revision 7273)
+++ restore.php	(working copy)
@@ -27,13 +27,14 @@
     if (! $course = get_record("course", "id", $id)) {
         error("Course ID was incorrect (can't find it)");
     }
+
     // To some reasons, course_startdateoffset value was lost during restoring
     // See MDL-17469
-    if (!empty($course->startdate) && !empty($SESSION->course_header->course_startdate)) {
+    if ((empty($SESSION->restore->course_startdateoffset)) && !empty($course->startdate) && !empty($SESSION->course_header->course_startdate)) {
         $SESSION->restore->course_startdateoffset = $course->startdate - $SESSION->course_header->course_startdate;
-    } else {
+    } else if (empty($SESSION->restore->course_startdateoffset)) {
         $SESSION->restore->course_startdateoffset = 0;
-    }
+    } 
 
     //Check login
     require_login();
