Page 1 of 1

Load tags from portable dbs to local

Posted: 15 Apr 2017 20:57
by Scorpio3002
I could probably find the answer to this by searching for it, but I figured it would be faster (and safer) to ask the experts; hopefully I have a good enough understanding of things to articulate my question. I've got thousands of tags saved to portable DBs which I would like to load into my local tag.dat under AppData. Or at least, that's what I think I want to do; basically, I'm trying to consolidate the tags from my C: drive and B: storage drive so that I can move them freely and have the tags go with them. I've tried the tagload function before, to load tags off of a portable hard drive onto my laptop, and it worked, but due to the way I had my storage set up it wound up erasing all the tags that I had stored on the laptop. Since it was a brand new laptop, I wrote this off as no big loss, but it has left me a little gunshy to try again, and would like to make sure that I do things the right way this time.

Re: Load tags from portable dbs to local

Posted: 15 Apr 2017 21:18
by highend
but due to the way I had my storage set up it wound up erasing all the tags that I had stored on the laptop
Maybe you should explain exactly why this happened. tagload is still the way to go...

Re: Load tags from portable dbs to local

Posted: 15 Apr 2017 23:01
by Scorpio3002
I still don't fully understand what happened, to be honest, but I'm pretty sure it had something to do with my storage settings: I currently have tags stored "Relative to tags database", and I think that's what setting I was on earlier, too. I thought I was safe creating a backup of the tag.dat file in AppData before running tagload, but then found that that file hadn't been updating.

Re: Load tags from portable dbs to local

Posted: 15 Apr 2017 23:18
by highend
Hard to say what went wrong. Maybe you check if the db to load and your current db use the same format next time?

E.g.:

Code: Select all

    $verLocalDB  = gettoken(regexmatches(readfile("<xydata>\tag.dat"), "^Storage: [0-4]"), 2, " ");
    $verImportDB = gettoken(regexmatches(readfile("<xydata>\<your .dat to import>"), "^Storage: [0-4]"), 2, " ");
    end ($verLocalDB != $verImportDB), "Local and db to import do not have the same storage type, aborted!";