Copying/moving DB from one install to another?

Information and Tutorials on features in Mylar and how to use it
Post Reply
Offspring
Posts: 271
Joined: Fri Jan 02, 2015 3:26 am

Copying/moving DB from one install to another?

Post by Offspring »

If I've got Mylar running on a Windows machine right now and I want to move it to a Linux machine, what specifically would I need to keep vs. leave behind to keep it running normally? Or would I just move the entire folder, update the locations for the Comics to be from (for example) C:\Comics to //media/whatever and then it should be fine?

If it's just dragging and dropping the folder, how come the cached images for the already downloaded series don't show up and I have to refresh each of the comics?
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Copying/moving DB from one install to another?

Post by evilhero »

Well if you're moving to a different OS, the best way is to:

On your original machine:
- backup your mylar.db and config.ini files. If you use the substitutes.csv, back that up too.
- backup your cache/ directory (this holds all of the covers)

On new machine:
- git clone a new repo (make sure to use the '-b development' switch so you're on the dev branch off the hop)
- copy your mylar.db, config.ini, and cache directory back in its entirety.
- make sure the perms are correct on the stuff in the step above.
- edit your config.ini.
locmove = 0
newcom_dir = ""
fftonewcom_dir = 0

For this to work you need to keep the Comic Location pointed to the original location. Once the changes have been made and the database changes are completed, then change the Comic Location to the new path, save and then restart Mylar.

Setting locmove = 1 will enable the one time mass update of comiclocation. If you leave newcom_dir blank (or as is "") it will not do anything. Setting a path (with no trailing slash!) will update every and all series to the newcom_dir path but keep the existing folder name for the given series that is already present. So if your:
ComicLocation = /mnt/evilhero/Comics

and

newcom_dir = /mnt/Comics

Upon the next startup/restart it will update the series location in Mylar from /mnt/evilhero/Comics</series> to /mnt/Comics/<series>, and then reset the locmove flag to 0 so it doesn't try to run on every startup thereafter.

fftonewcom_dir (0/1). Enabling this option will apply your current Folder Format string to every directory change that's being done at the same time as it's converting directories. This also includes subdirectories within the Folder format (ie. '$Publisher/$Series/$Volume ($Year)')
Offspring
Posts: 271
Joined: Fri Jan 02, 2015 3:26 am

Re: Copying/moving DB from one install to another?

Post by Offspring »

Resurrecting a 2-month old thread. Yay!

So what do I do about the log and cache dirs? Should I just leave them alone in the config.ini, or should I go through and fix everything so that it matches going from Winders to Lunix?
Offspring
Posts: 271
Joined: Fri Jan 02, 2015 3:26 am

Re: Copying/moving DB from one install to another?

Post by Offspring »

Also, I did half of it, as I didn't actually move the files I just setup a share to them and pointed to them on the new system. Whenever I click the little "i" for info to view the Comic details, it's throwing 500s at me. I can't see anything in the logs to tell me what's going on, though. Any idea what could be causing that?

Edit: I'm assuming the 500s are due to the fact that I hadn't changed the config to move all of the folders. I did that, but it's still staying at the old D:\. I'm going to try using the ffto flag, but I think something's not working right :(.

Edit 2: OK, that fixed the 500s...mostly. I got the main folders fixed, however it's tacking on an additional \, so for example /media/Newsgroups/Comics/Dark Horse Comics\The Last of Us Preview (2013). Any way of mass updating the last backslash to be a forward slash?
Last edited by Offspring on Sun Mar 15, 2015 2:13 am, edited 2 times in total.
Offspring
Posts: 271
Joined: Fri Jan 02, 2015 3:26 am

Re: Copying/moving DB from one install to another?

Post by Offspring »

And another bug I just found: I'm being told I have no search providers active, I need at least 1 but I've got 3 set. What would cause that?

Edit: Ah-hah! I had to disable and then re-enable the search providers for the new install to recognize that they existed. Good to know.
Offspring
Posts: 271
Joined: Fri Jan 02, 2015 3:26 am

Re: Copying/moving DB from one install to another?

Post by Offspring »

And another. Post-processing errored out. Here's the error:

Code: Select all

Opening URL: http://localhost:8090/post_process?nzb_name=Ant-Man_003_%282015%29_%28Digital%29_%28Zone-Empire%29&failed=0&apc_version=1.0&comicrn_version=1.0&nzb_folder=D%3A%5CNewsgroups%5CComics%5CAnt-Man_003_%282015%29_%28Digital%29_%28Zone-Empire%29
nzb name: Ant-Man_003_(2015)_(Digital)_(Zone-Empire)

nzb folder: D:\Newsgroups\Comics\Ant-Man_003_(2015)_(Digital)_(Zone-Empire)

nzbname: Ant-Man.003.(2015).(Digital).(Zone-Empire)

Failure - could not initially locate nzbfile in my database to rename.

trying again with this nzbname: Ant-Man.003.2015.Digital.Zone-Empire

Unable to locate downloaded file to rename. PostProcessing aborted.
It looks like it's looking for the NZB in a folder that doesn't exist, since it's Linux talking to Windows, and the comic should be in /media/Newsgroups/Comics not D:\Newsgroups\Comics. Where do I find where it's looking for that folder so I can tweak it? Is that in the .cfg file?

And for this I'm running Version: 052e6ecb0bb97721c10ae73cdf4c3e98487e33d2 (development) on Ubuntu 14.04.2 LTS.
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Copying/moving DB from one install to another?

Post by evilhero »

The post-processing error is probably due to having sabnzbd and mylar in different machines (I'm just assuming this).

If that's the case, make sure that you point the download directory within mylar to the location on Linux where the downloads go (mount it to the share on Windows kinda thing).

Otherwise, make sure the category you're using for comics in sabnzbd is pointing to the correct local location (in this case, sabnzbd and mylar would have to exist on the same machine).

The 500 error, might be due to having a trailing slash in thefftonewdir path (or if there's one there, then it shouldn't be there)

Sounds like you've been having fun!
Offspring
Posts: 271
Joined: Fri Jan 02, 2015 3:26 am

Re: Copying/moving DB from one install to another?

Post by Offspring »

I figured out the 500 error...sort of, but the problem is that it's adding the wrong slash at the end of the Comics folder for the Publishers, and I have to go through and manually update each. Considering I've got like 600 comics that's...not exactly exciting. Should I include the / in the fftonewdir? You said not to, but without it, it seems like I'm completely hosed.
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Copying/moving DB from one install to another?

Post by evilhero »

Have you changed the slash in your Folder format string (from $Publisher\$Series.. to $Publisher/$Series)?

You can then the fftonewcom_dir option to 1.

In the second post, I had mentioned that you can't have trailing slashes in either you comic location or your newcom_dir.. So I'm thinking that you had the trailing slash in, which caused it to think it was part of the folder-path and kept it in when it was converting everything. So change your newcom_dir (do not change your Comic Location path at all until everything is done) so there isn't a trailing slash, then enable the fftonewcom_dir option to 1 (set locmove to 1 as well). Then make sure your Folder format string has the correct slashes for the os that mylar will reside on. Save the config and start up mylar and it should fix things.
Offspring
Posts: 271
Joined: Fri Jan 02, 2015 3:26 am

Re: Copying/moving DB from one install to another?

Post by Offspring »

I didn't change the format string, and I definitely did not have a trailing slash as I hand wrote everything and made sure it wasn't there. Not exactly easy to add the / when it's to the left of the Shift without trying to :).

Edit: OK, updating the $Publisher/$Comic ($Year) and then re-doing the ffto flag worked to update them all. Now if only I could figure out why the post-processing wasn't working properly when running on a different server, it would be perfect.
Post Reply