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.

    Is it possible to clone an existing Magic Mirror installation on a Fresh Installation of Raspbian ?

    Scheduled Pinned Locked Moved General Discussion
    8 Posts 2 Posters 2.5k Views 3 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
      Rags
      last edited by

      Of late I am having certain issues with my OS on my Raspberry Pi 3B+ (32 GB SD Card). While there is no issue with the MagicMirror installation, configuration issues relating to display and sound of the Pi are plaguing me and no amount of update and upgrade of OS are resolving the issue. I have decided to do a fresh install of the OS onto a new SSD device. However, i want to retain the Magic Mirror installation intact, as the process of reinstalling all the modules (I have more than 15 running) would be very time consuming. I am thinking of a fresh install of MagicMirror on the SSD. However, will it be a good idea to overwrite the MagicMirror modules and config directory after the fresh install of MagicMirror with modules and config directory from the the older SD card? I have a feeling it may not work. So what is the easiest way to avoid the tedious process of migrating the MagicMirror from old SD card to new SSD? Thanks

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @Rags
        last edited by

        @Rags use my backup/restore
        https://github.com/sdetweil/MagicMirror-backup-restore

        it saves the config.js, custom.css and the GitHub url of the modules installed

        then after you install mm (using my install script of course), the restore installs all the modules again and restores the two files.

        you can use backup. to make incremental backups using git and store those on GitHub, so they are not lost if u have SD card issues

        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
          Rags @sdetweil
          last edited by Rags

          @sdetweil Thanks for the reply. If i understood correctly, the steps involved would be;

          1. Run your backup script and take a backup of the existing MM installation and save it to an externally location.
          2. Install a fresh Raspberry Pi OS on the new SSD.
          3. Install MM using your script.
          4. Copy the saved MM backup directory to the new SSD MM directory.
          5. Run your restore script to restore the MM to the original configuration.

          So if these steps are followed, will just running the restore script ensure ;

          1. All dependencies will also be automatically loaded and configured?
          2. Is there any other configuration setting specially for GPIO control that may be required?
          3. Are there any other additional scripts that may be required to be run?

          Sorry for requesting for specific queries to be answered. I don’t want to goof up the installation and then spend hours to recover.
          Thanks

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @Rags
            last edited by sdetweil

            @Rags the backup can be auto uploaded to a git repo, and auto downloaded during restore.

            it doesn’t copy any module folders, just the url where the module was loaded from, so that they can be installed again (git clone, npm install if required, and fix for missing libs too)

            see
            git remote -v
            in any module folder

            system config (like enabling gpio, setting screen orientation) is not detected.
            this would require a disk image, but you would get exactly what you have now, if broken, it’ll be broken.

            the backup is tiny. 3 files. config js, custom.css and the file with the list of urls.

            because no changes are done to the existing mm installation, you can run backup now

            use a new SD card, install. raspi os.
            use my script to install mm
            run the restore

            all of that should take less than 30 minutes.
            and you have your existing SD card untouched.

            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
              Rags @sdetweil
              last edited by

              @sdetweil Ok i finally managed to migrate to a new SSD. However, it was not without surprises. i had to

              1. Redo a npm install on a few modules to make them work.
              2. MMM-Google photos module folder was missing the token.json file had to be recopied from backup(Thank god i had module folder on my SD)
              3. API key of MMM-OpenAi had to be recreated and stored in .env file.
              4. The PM2 did not work with the automated installation. I got an error [PM2][ERROR] File ecosystem.config.js not found. Could be an error from my side while configuring, not sure. I deleted the instance of pm2 and reinstalled manually.
                But the process was not smooth, it took some doing, but finally my new MM seems to been successfully cloned. Yet to fully check all modules.
                I have regained configuration control of the display and have been able to rotate it to Portrait mode. i am yet to check sound configuration.
              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @Rags
                last edited by sdetweil

                @Rags thanks for the feedback

                \1. what modules? I’d like to examine that. the restore does npm install if there is a package json or there is a node_helper that uses one of the removed libs (after creating the package
                json)

                \4. this is w my install script, right? can u send me the ~/install.log
                same userid at gmail

                2/3. yes modules that depend on other files that I don’t know about.

                still. less than a day is a win

                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
                  Rags @sdetweil
                  last edited by Rags

                  @sdetweil said in Is it possible to clone an existing Magic Mirror installation on a Fresh Installation of Raspbian ?:

                  @Rags thanks for the feedback

                  \1. what modules? I’d like to examine that. the restore does npm install if there is a package json or there is a node_helper that uses one of the removed libs (after creating the package
                  json)

                  \4. this is w my install script, right? can u send me the ~/install.log
                  same userid at gmail

                  2/3. yes modules that depend on other files that I don’t know about.

                  still. less than a day is a win

                  I have mailed you the install.log file. Few of the modules that needed npm install (as far as i remember) are DHT sensor, PIR sensor, GPIO notification, speedtest, mmm-tools, default calendar, Open Ai, Google photos; the list is incomplete as i dont remember now. Anyways i feel there could be certain issues which either got sorted automatically during reboot or after npm install .
                  The font awesome icons for calendar are not showing up, the speed test module has been put in EOL, so it did not fire up. So i guess the script should detect if a certain module is in EOL in the github and suggest a backup.

                  During restore of MM the following msg was visible;
                  npm WARN old lockfile
                  npm WARN old lockfile The package-lock.json file was created with an old version of npm,
                  npm WARN old lockfile so supplemental metadata must be fetched from the registry.
                  npm WARN old lockfile
                  npm WARN old lockfile This is a one-time fix-up, please be patient…
                  npm WARN old lockfile
                  npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Mat>

                  Do i need to upgrade to ver 7 ??

                  Finally, yes your script to backup and restore is certainly a win. Thanks

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @Rags
                    last edited by

                    @Rags can u send me the module_list file from the backup

                    the package-lock.json message is noise. sadly we can’t suppress those

                    UUID message. this is a sign that the module hasn’t been updated in a while. there is no telling what the impacts of the update might be. there are breaking changes everywhere.

                    I strongly recommend ignoring the messages.

                    I don’t see any issue in the pm2 setup during install. I ask it for the command IT thinks it needs to execute, and then I execute that command. same as u did manually

                    I will get the os level u used and test, thanks.

                    there is no good way to test for module eol, as only 1 developer uses that term
                    lots of modules have been abandoned, but still work.

                    on the not copied files (token.json, env…) I might have an idea there.

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    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
                      OSZAR »