MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MagicMirror-backup-restore

    Scheduled Pinned Locked Moved Solved Troubleshooting
    7 Posts 2 Posters 43 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      rkorell
      last edited by rkorell

      Dear Sam ( @sdetweil) ,

      Hope you’re doing well! I’ve been using your MagicMirror backup-restore scripts for quite a while
      now and they’ve been super helpful - thank you so much for maintaining them!

      I just ran into a small issue that I wanted to share. At some point in the past, I had used
      mm_restore.sh, which left my local backup repo on a branch called restore-branch. When I ran
      mm_backup.sh today (after a loooong time) , it committed the backup to restore-branch (since that was
      the checked-out branch), but the push command on line 511 explicitly pushes main:

      git push -u origin main refs/tags/$next_tagnumber

      So the tag got pushed correctly, but the actual backup commit never made it to main on GitHub -
      because the commit was on restore-branch while the push targeted main (which still pointed to the
      old commit).

      Easy fix on my end - I just merged restore-branch into main and pushed. But you might want to add
      a git checkout main (or git switch main) somewhere before the commit step in mm_backup.sh, so the
      script always commits to the right branch regardless of which branch happens to be checked out.

      Thanks again for all your work on this - and for all the help you are performing here for us!

      Ralf

      S 1 Reply Last reply Reply Quote 0
      • R rkorell has marked this topic as solved
      • S Do not disturb
        sdetweil @rkorell
        last edited by sdetweil

        @rkorell thanks.

        Hm.
        If I git remote on the backup folder.
        And git branch on the folder and
        they are different what do you think I should do

        What is the right branch?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          rkorell @sdetweil
          last edited by rkorell

          Dear Sam, @sdetweil ,

          sorry for the late reply — time zones 😊 (it was night here in Germany when you posted).

          To answer your question: the right branch is main.
          That’s where mm_backup.sh pushes to
          (git push -f origin main) , and that’s where backups should live.

          The problem is that mm_restore.sh creates and checks out a “restore”-branch but never switches back (to main) or deletes “restore” afterwards. So after a restore, the local repo stays on restore-branch.

          When mm_backup.sh runs next, it does git add and git commit — which goes to the currently checked-out branch (restore-branch), but then pushes main. So the new backup commit is “lost” on the wrong branch.

          I think the simplest fix would be to add a git checkout main at the beginning of mm_backup.sh,
          before any git operations. That way it always commits to the right branch regardless of what
          happened before.

          Alternatively, mm_restore.sh could clean up after itself by switching back to main and deleting
          restore-branch when it’s done.

          Thanks for looking into it!

          Warmest regards,
          Ralf

          S 1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @rkorell
            last edited by

            @rkorell no sorry needed. We all respond when we can

            Got it. Both scripts are broken

            Backup for not checking and correcting
            Restore for not cleaning up

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            R 1 Reply Last reply Reply Quote 1
            • R Offline
              rkorell @sdetweil
              last edited by

              @sdetweil OK; cool! Thanks again for all your effort!

              Warmest regards,
              Ralf

              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @rkorell
                last edited by sdetweil

                @rkorell I have pushed fixes for both scripts to handle this error in the previous versions…

                both backup and restore will handle the case where the restore-branch exists (as now)
                and cleanup after…

                thanks for the report and feedback

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                R 1 Reply Last reply Reply Quote 1
                • R Offline
                  rkorell @sdetweil
                  last edited by

                  @sdetweil resolved in less than 24 hours :-) This is “responsive” !
                  Thanks again!
                  Ralf

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy