Read the statement by Michael Teeuw here.
Is it possible to clone an existing Magic Mirror installation on a Fresh Installation of Raspbian ?
-
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
-
@Rags use my backup/restore
https://github.com/sdetweil/MagicMirror-backup-restoreit 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
-
@sdetweil Thanks for the reply. If i understood correctly, the steps involved would be;
- Run your backup script and take a backup of the existing MM installation and save it to an externally location.
- Install a fresh Raspberry Pi OS on the new SSD.
- Install MM using your script.
- Copy the saved MM backup directory to the new SSD MM directory.
- 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 ;
- All dependencies will also be automatically loaded and configured?
- Is there any other configuration setting specially for GPIO control that may be required?
- 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 -
@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 foldersystem 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 restoreall of that should take less than 30 minutes.
and you have your existing SD card untouched. -
@sdetweil Ok i finally managed to migrate to a new SSD. However, it was not without surprises. i had to
- Redo a npm install on a few modules to make them work.
- 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)
- API key of MMM-OpenAi had to be recreated and stored in .env file.
- 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.
-
@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 gmail2/3. yes modules that depend on other files that I don’t know about.
still. less than a day is a win
-
@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 gmail2/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 uuid@3.4.0: 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
-
@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.