Backup from Synology

Information and Tutorials on features in Mylar and how to use it
Post Reply
Natsumiko
Posts: 4
Joined: Sat Nov 04, 2017 8:47 am

Backup from Synology

Post by Natsumiko » Sat Nov 04, 2017 8:53 am

Hi,

I'm having an issue with my Synology NAS setup where one hard drive was broken and a second one also started giving issues the moment i replaced the broken hard drive. When rebooting my synology only marks degraded, but after some hours it goes to crashed.. I'm able to backup everything when it's in degraded state and so far everything even seems to open.

However i will be replacing both hard drives now and start new, but i'd like to backup all mylar settings and database. Could someone tell me how to do this and more importantly what files i need to backup.

Also to restore i'm guessing best way to do this is reinstall Mylar, update to the same version as what it is now, shut down mylar and replace all the files by the ones i backupped then start it back up.

I'm a bit against the clock here, so a fast answer would be mostly appreciated :)

User avatar
evilhero
Site Admin
Posts: 2027
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Backup from Synology

Post by evilhero » Sat Nov 04, 2017 1:02 pm

Just backup your existing mylar.db, config.ini and your entire cache directory (just the. jpg's - these are the images that are displayed for covers).

Then just reinstall mylar as if it were a new installation. Making sure it's the exact same commit doesn't matter as mylar has checks built in to ensure items are present and if not it will create them (ie. Fields missing from the database, etc).

The only caveat is that if you're on the development branch you need to ensure that's what you installed. Also make sure the permissions/owner are set correctly, especially for the cache folder as this will cause problems when refreshing / adding series otherwise.


Then just drop the backed up files into the new location start up mylar and that's it (no need to run it first).

Natsumiko
Posts: 4
Joined: Sat Nov 04, 2017 8:47 am

Re: Backup from Synology

Post by Natsumiko » Sun Nov 05, 2017 12:16 pm

Thanks for the answer, I managed to get a backup from my files and will add how i did it here since it cost me a while to figure this out and this might help someone else one day:

- Create a folder appstore in shared folders and make sure you assign yourself rights to this folder

- Enable telnet on your synology nas by going in the control panel

- Get a telnet client, I just enabled the Windows telnet client from Control Panel -> Add/Remove Software -> Add Windows Features

- Telnet to your Synology NAS with following command : telnet IPADDRESSSYNOLOGYNAS

- Login with your user credentials

- type: sudo -i

- Enter password again, for me I always have to enter it twice, first time fails, second time works, don't know why

- type: mount --bind /volume1/@appstore /volume1/appstore

If you now use Windows explorer to go to your NAS you should see the previously hidden @appstore folder in the appstore folder you created



@ Evilhero:
Since I had to reconfigure everything anyway I decided to start using Docker. I managed to get Mylar running and I think I added all the parameters correctly but I can't open Mylar. When checking the logs i get the following error:
  • IOError: [Errno 2] No such file or directory: u'/usr/local/mylar/var/logs/mylar.log'
    2017-11-05 12:02:04 stdout stream = open(self.baseFilename, self.mode)
    2017-11-05 12:02:04 stdout File "/usr/lib/python2.7/logging/__init__.py", line 943, in _open
    2017-11-05 12:02:04 stdout StreamHandler.__init__(self, self._open())
    2017-11-05 12:02:04 stdout File "/usr/lib/python2.7/logging/__init__.py", line 913, in __init__
    2017-11-05 12:02:04 stdout logging.FileHandler.__init__(self, filename, mode, encoding, delay)
    2017-11-05 12:02:04 stdout File "/usr/lib/python2.7/logging/handlers.py", line 64, in __init__
    2017-11-05 12:02:04 stdout BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
    2017-11-05 12:02:04 stdout File "/usr/lib/python2.7/logging/handlers.py", line 117, in __init__
    2017-11-05 12:02:04 stdout file_handler = RFHandler(filename, "a", maxBytes=MAX_SIZE, backupCount=MAX_FILES)
    2017-11-05 12:02:04 stdout File "/app/mylar/mylar/logger.py", line 109, in initLogger
    2017-11-05 12:02:04 stdout logger.initLogger(console=not QUIET, log_dir=LOG_DIR, verbose=VERBOSE) #logger.mylar_log.initLogger(verbose=VERBOSE)
    2017-11-05 12:02:04 stdout File "/app/mylar/mylar/__init__.py", line 1172, in initialize
    2017-11-05 12:02:04 stdout mylar.initialize()
    2017-11-05 12:02:04 stdout File "/app/mylar/Mylar.py", line 206, in main
    2017-11-05 12:02:04 stdout main()
    2017-11-05 12:02:04 stdout File "/app/mylar/Mylar.py", line 274, in <module>
    2017-11-05 12:02:04 stdout Traceback (most recent call last):
Do you have any idea what I'm doing wrong? First time ever for me to be using Docker so might be that i missed something.

I used following parameters:

Volume:
/docker/Mylar Config - /Config
/Data/Comics - / comics
/downloads/Download Station /downloads

Port:
Local Port 8090 - Contailer Port 8090

And in Environment i specified my PGID and PUID

Edit: I'm using the linuxserver Mylar Image btw

Natsumiko
Posts: 4
Joined: Sat Nov 04, 2017 8:47 am

Re: Backup from Synology

Post by Natsumiko » Sun Nov 05, 2017 12:48 pm

So it seems like it happens when I put the config back. When i just startup Mylar everything seems to be working normally, this only appears when i overwrite my backup config.

I deleted the old config file but just copied the cache and mylar.db file, that was the most important part for me anyway :)

Natsumiko
Posts: 4
Joined: Sat Nov 04, 2017 8:47 am

Re: Backup from Synology

Post by Natsumiko » Sun Nov 05, 2017 2:08 pm

And the final reply. Putting the db file back still located to different folders within Mylar, so when post processing it couldn't find newly downloaded issues. But was able to change those by editting the paths with DB Browser for SQLite 3.1 so all my issues are fixed and at least now it's up and running in Docker :D

User avatar
evilhero
Site Admin
Posts: 2027
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Backup from Synology

Post by evilhero » Sun Nov 05, 2017 6:34 pm

It looks like you had the logs directory set to be in a path that didn't exist (in the config.ini it would be under a variable called log_dir and probably was pointing incorrectly to: /usr/local/mylar/var/logs/mylar.log). If the log_dir wasn't specified, it just tries to create it in the data_dir location, which can be specified as a command line switch when starting Mylar (either as a daemon or from the cli).

So odds are all you had to do was either correct the log_dir path in the original config.ini, or delete the line entirely and it would've just recreated it ;)

As far as the paths - because the paths were different than what they were originally, and as Mylar stores the paths in the db for tracking purposes, it would fail to locate them as you found out. There is a bit of a system involved in just changing the paths (there are variables in the config.ini, that when enabled will initiate a db conversion changing all the old paths to the new paths), but since you already did it via the DB Browser you're probably fine going forward. You should ensure that your Comic Location path however is pointing to the correct path location now, as any future series adds, and possible series refreshes will attempt to locate the existing directories at the Comic Location path.

Post Reply