Read the statement by Michael Teeuw here.
Backing up via GitHub repo
-
Have you considered forking the entire Magic Mirror repository? You could then adjust the gitignore file appropriately and have the entire thing available for you.
-
@bhepler Would it then still be possible to update the MagicMirror? I figure it would be, but just to be sure. Do you think this is the best way to backup my MagicMirror setup?
Thanks for your response!
-
@arnedebeer you can, but private repo is not free
i backup the MM folder to my PC, then delete the node_modules folders where I find them
and then zip the thing onto an external drive, that is backed up to the cloud.so I have 3 layers of backup, pc, external disk and cloud
i have 2 external drives, 5 and 8 terabytes. and sometime copy from one to another for another layer.
on my pc, I run two 4tb drives in raid 0, so if one dies, I can get the data back
I do my cloud back ups with backblaze, as it does continuous incremental backups…on my critical mirror devices, I have gone to booting the sd card, but running from SSD disk.
so the sd card usage is minimal. -
@sdetweil a private repo on GitHub is free though!
-
@arnedebeer well, then, didn’t used to be… I see its changed… thanks…
-
@sdetweil perhaps your four layer backup routine isn’t needed after all!:winking_face:
-
In all honesty I don’t think it’s necessary to back up your entire Magic Mirror. If you back up the
config.jsfile, you can rebuild your mirror pretty quickly. It will contain all of your API keys and a list of the modules you have installed. The hard part will be locating the Github repos to clone the repositories.And you did star all of the module repositories you need, right? That would put them all on a very convenient web page.
-
@arnedebeer well, there is a LOT of stuff on this machine… lots more than MM…
-
@bhepler I think you’re quite right to be honest. But by forking the entire project this won’t be possible, that’s why I was hoping it was possible to create a repo for it to automate the backup.
Perhaps a better way to back my config up is to create a script that mails the config every x amount of time to myself :thinking_face: :thinking_face:
-
@arnedebeer - If you must. I make it a practice that I back up the
config.jsjust before I modify it. That way I don’t have a dozen identical copies of the file sitting around. It also lets me easily see when was the last time I changed the mirror.BitVise is good for this, as it will open a terminal window and an SCP window, which serves as a good reminder to copy the config file down before I do anything.
-
you can do that with a git repo which is located above your
MagicMirrorgit repo.If you have a path structure e.g.
~/mm/MagicMirrorwhereMagicMirrorcontains the MagicMirror-git-repo goto~/mmand create a new git repo there withgit init. Create a.gitignorefile in~/mmand put the lineMagicMirrorin it so this subdir is ignored.Now you can add files or directories with
git add -f MagicMirror/config/config.js git add -f MagicMirror/modules/*Then commit.
-
The MM repo has a git configuration to only track the “default” folder in the MM/modules folder. This is cool because you can have a separate git repository inside another! When you like a module someone (even yourself) created on github, you need to install it in the MM/modules folder. For example, from the MagicMirror/modules directory, I’m cloning a repo:
[MagicMirror/modules]> git clone https://github.com/sdetweil/MyCovid19.gitYou’ll see that a new directory is created under the “modules” directory – and it’s the same name as the git repository. Important to this discussion; the MagicMirror repo doesn’t care about this new directory! You follow the usual steps to update MM with no git side-effects … and … you can update the new module directory that you cloned using the same “git pull” process!
Side note: there are often a few more steps needed to install a module. In this example, @sdetweil follows best practice to include installation instructions in the module README.
So, in a general case, you can create a repo, for example, “MyStuff” in the MM/modules folder. It can contain anything and you can manage it (edit files/push/pull/branch/etc.) all within the “MM/modules/MyStuff” directory.
Just don’t call your repository “default”! :-b
fyi - Git keeps track of files/directories to ignore within a repository by using a .gitignore file located in the repo’s root folder. Check out all the files the MagicMirror ignores!
-
@karsten13 Git supports nested repositories. No need to create a higher level repo and then ignore the MagicMirror. There’s already a line in the MagicMirror/.gitignore
# Ignore all modules except the default modules. /modules/**So anything can be created in the MagicMirror/modules directory – and it is ignored by the MM repo.
-
My answer is related to
I was wondering how I could backup my config and modules folder to a private repository on GitHub.So if you want to put
configandmodulesin one git repo without the other MagicMirror stuff, if found no other solution as doing it with such a “parent” construction as described … -
@karsten13 You are correct that a parent /mm/ repository could nicely include the MagicMirror/config/config.js file while excluding the ‘core’ MagicMirror! :clapping_hands_medium-light_skin_tone:
Minor thoughts:
- Using your suggested command in that parent /mm/ repository,
… will include the modules/default/ directory.git add -f MagicMirror/modules/*
Since it is included by the MagicMirror repository. I suggest only adding the specific paths to any modules you have edited. - also add the .gitignore to the parent /mm/ repository.
- Using your suggested command in that parent /mm/ repository,
-
:thumbs_up:
-
Here’s what I’ve done.
Everything I modify, including instructions for things that can’t be moved is stored in a “MyConfigs” directory on my harddrive, with symlinks in the original folder - so config.js and custom.css is actually symlinks in the magicmirror folders.
Modifications to modules that I do are all forked off the original and stored independently.
It took me literally 5 minutes to get config up again after a SD Card blowout…
Pros: no work to get unmodified modules and MagicMirror up to current.
Cons: remembering the dang symlink command. I’m gonna write a script.
-
Thanks all for your responses! I am going to try @karsten13’s answer and setup a parent repository above the MagicMirror directory! Funny how I did not thank of that :D
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login