Load tags from portable dbs to local

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Scorpio3002
Posts: 21
Joined: 21 Aug 2016 05:16

Load tags from portable dbs to local

Post 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.

highend
Posts: 15000
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Load tags from portable dbs to local

Post 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...
One of my scripts helped you out? Please donate via Paypal

Scorpio3002
Posts: 21
Joined: 21 Aug 2016 05:16

Re: Load tags from portable dbs to local

Post 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.

highend
Posts: 15000
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Load tags from portable dbs to local

Post 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!";
One of my scripts helped you out? Please donate via Paypal

Post Reply