Converting custom fields into tags

gordcook
gordcook
Community Member

I'll start from the beginning because I hate it when someone has gone so far down the incorrect rabbit hole and doesn't know how to proceed. And then they ask the wrong question without context. In reality, they're trying to solve the wrong problem.

I am migrating from KeePass 2.X to 1Password (Families, if that matters). I wrote an XSLT to translate the XML to CSV. I included the group at the end of the line (custom field 1) since there was no column for it in the documentation. Now that the data is imported and I have been using it for a while, I see that I would have preferred to have imported the group name as a tag. Trying to search, filter, or otherwise organize by a custom field does not appear to be a useful strategy.

Now, there seems to be no way to import tags from CSV using the documented method. And, I could not find a way to automatically convert all of the custom fields into tags. Manually transferring the information from the custom field to a tag and removing the field seems prohibitively time-consuming on hundreds of entries.

So, I started thinking out of the box:
I exported all my login records into a CSV file. The CSV export file format does not conform to the documented CSV format, but does include a 'tag' column. If I open this with Excel, I can copy the values from 'field' to 'tags', and remove all the custom fields and custom sections from my entries. It's messy, but doable. Then my plan is to re-import the modified CSV back into the same vault.

My expectation is that the uuid field will prevent duplication and cause each imported record to replace the matching record in the vault. I'm reluctant to attempt this in my live vault without some assurances that it will work.

That said, if I'm in the wrong rabbit hole and there is a much simpler solution, I'd love to hear it.


1Password Version: 7.3.657
Extension Version: Not Provided
OS Version: Windows 10 version 1803
Sync Type: Not Provided
Referrer: forum-search:Converting custom fields into tags

Comments

  • MrC
    MrC
    Volunteer Moderator
    edited February 2019

    @gordcook ,

    You've done a lot of perhaps needless work and have fallen into your own rabbit hole! There is a keepass2 converter in the converter suite. Are you too far along to re-converter your XML export and start anew?

    The keepass2 converter automatically converts the group into a tag hierarchy.

    I'm happy to provide you with a customized version to create whatever other tags you need.

  • gordcook
    gordcook
    Community Member

    @MrC I suppose I'm not that far along. I added URLs to quite few entries to get the rich icons, but I'd rather redo that than manually convert the fields to tags. :) I haven't tried it yet, but I'm reading the documentation. It looks like I need to wipe my vault before I re-import, do I have that correct? If so, is the easiest way to go to "All Items", select all, right click, Move to Trash. And then right click on Trash and Empty Trash? Is it okay to deselect the "Starter Kit" items? Will that be clean enough?

    Thank you so much for creating this tool.

  • MrC
    MrC
    Volunteer Moderator
    edited February 2019

    @gordcook ,

    You don't need to wipe your vault. Some options:

    1. Import the new items into a new temporary vault (and move items when you are happy).

    2. Add a tag on conversion (so you can identify the new items), you can use the --tag converter option.

    3. You can just move your current items to a different vault

    4. You can leave your items where they are and give them all a tag such as OLD. Then you can quickly select these, and also compare your new vs. old entries quickly if you need to (cycle between new / old Up and Down arrows on the keyboard - differences will be obvious). I do export / convert / import all the time. Getting rid of old items is easy, but having them around to compare my code change results is very useful.

  • gordcook
    gordcook
    Community Member

    Works like a charm!! Thank you @MrC for all of your help!

    It's a shame that there isn't at least some kind of footnote on this page that mentions this tool. It would have saved me a ton of time and headaches a week ago.

  • MrC
    MrC
    Volunteer Moderator

    You’re welcome @gordcook .

    There used to be a reference on the page, but for some reason the 1Password folks removed it. I can understand their reluctance to appear to be guiding users to some external solution for these conversions. And they end up catching flack from the Windows users who need to install the Perl environment.

    Enjoy 1Password!

  • AGAlumB
    AGAlumB
    1Password Alumni

    @gordcook: I'm really sorry for missing this until now, and for the difficulty you had getting your exported data into the form you wanted, but glad that it seems to have worked out in the end. :)

    @MrC: While it's definitely tricky figuring out when and how is appropriate to suggest this solution, we're eternally grateful that it exists. Thanks for all you do! <3

  • gordcook
    gordcook
    Community Member

    @brenty: No worries. I recognize that there were a ton of demands on your time with the highly public memory management concerns. On the bright side, I learned more about XSLT in a week than I had learned in the previous two decades. ;)

  • AGAlumB
    AGAlumB
    1Password Alumni

    A learning experience is always a good thing. Just sorry you had to learn "the hard way" in this case. Thanks for your patience and understanding! :chuffed:

This discussion has been closed.