MrC's Convert to 1Password Utility (mrc-converter-suite)
Comments
-
Ok, sorry for the inconvenience.
Can you try this for me and let me know if it works out?
Launch the
portableshell.bat
as instructed in the README. Then run the command:cpanm install Date::Calc
exactly as typed and hit Enter.
If that succeeds, continue following the instructions from step 3d in the README.pdf.
0 -
Thank you. The
Date::Calc
module installed successfully and my test import into 1Password also was successful.One last remaining question before we perform the real import. As you know, Keepass2 entries can be hierarchical and this is how we have organized all of our content. Is there any way for the converter to read the "path" of the entry and store that in 1Password, perhaps with a tag or section label (whatever is the least amount of work for you)? I'm not sure if you have something for this already but anything we can pull across to help with organizing in 1Password would be of benefit. Thanks for your help, time & consideration.
0 -
That's great news, thanks!
The full path of a Group in keepass2 is already captured, but the separator I'd chosen a long time ago was double-colon
::
. I've just posted version 1.11 in Testing Bits which changes this to a forward slash, so that you get:Testing Bits is mentioned in the first post of the converter suite thread.
0 -
Excellent! I'll use Testing Bits v1.11. Thanks.
0 -
Not seeing the keepass2 group paths as tags in 1P. Here's the sequence of events I performed.
1. deleted directoryc:\myperl
2. extracted StrawberryPerl v5.24 toc:\myperl
3. downloaded Testing Bits v1.11; extracted; copied theconvert_to_1p4
directory to the desktop
4.C:\myperl\portableshell.bat
5.%userprofile%\desktop\convert_to_1p4\install_modules.bat
(all looked successful)
6. changed working dir to%userprofile%\desktop\convert_to_1p4
7.perl convert_to_1p4.pl keepass2 -v <path_to_my_keepass_export.txt>
The .1pif import file generates without issue, imports into 1P without issue and all entries are present. I have tags that show the imported timestamp, but no tag for the keepass2 group paths.
0 -
FYI: you don't need to run the install_modules.bat script again - you ran it after you installed Strawberry Perl, and those installed modules remain installed.
Do you see in your Keepass2 XML export a
<Group>
hierarchy such the image below shows for my example above?and the debug output with
-d
would show:0 -
Thank you! I was testing my KeePass exports by only exporting a small subset of data, in this case, one folder (group) containing three entries. Your last post about running the conversion in debug helped me to see that get_group_path was returning null for all three entries. When I experimented by exporting one level above the folder I originally selected, I then saw that get_group_path was returning the group name for any child groups. So in the end, everything actually was working; it was my limited test data that led me to believe it was not working. Now that I have imported my production data, everything looks great. Not only are all of my KeePass group names intact in 1Password tags, but I did not expect the tags to nest based on the "/" separator! That's awesome. You did a great job on this converter. And the fact that you developed this with several conversion sources for all to use without charge is very cool. We would like to contribute to your efforts. Do you have a Patreon?
0 -
Hi there,
I'm not sure if this has been answered (all I found was a mention of how difficult Apple has made it to copy iCloud keychain items), but I can't copy my keychain items from iCloud to local-cloud. I get this error code:"An error has occurred. Unable to add an item to the current keychain. One or more parameters passed to a function were not valid."
If I use the iCloud password (as opposed to the local keychain password) I get the following error:
"An error has occurred. Unable to add an item to the current keychain. The contents of this item cannot be retrieved."
I can't think of anything else - where am I going wrong?
0 -
Master MrC, we are waiting you impatiently, for the AppleScript for Safari.
can we export all keychain passwords0 -
Hi MrC,
I am trying to copy my iCloud Keychain into my newly created local-icloud keychain just how the the guide says but am having trouble.When I paste it into local-icloud I get a prompt which says 'Keychain Access wants to use the "Local Items" keychain' which requests a password. However once I enter it says ' An error has occurred. Unable to add an item to the current keychain. One or more parameters passed to a function were not valid.'
Im not entirely sure why since I am entering the password. I've even tried other passwords but none of them are working. I am even able to unlock both the keychains. What should I do?
0 -
See my post from Jul 22 above.
0 -
MrC we are waiting you
0 -
Edit: please see this post instead.
Hi @Commander86 @fathertime @kabo @ppeepp @matan
Your wait is over....
Edit: Safari 12 users please also see this post
In Testing Bits, mentioned in the first post of this converter suite thread, is an Applescript named GetSafariPasswords. You can copy it to your system to use. You can open and examine it with Script Editor.
Once I've worked out any kinks, I'll incorporate it into the AppleScript_Conversion_Helper. But for now, here are your steps:
- Open the script with Script Editor
- Launch Safari
- Open Safari's preferences and navigate to the Passwords tab
- Unlock the dialog so your list of credentials is visible
- Switch back to Script Editor and hit its Run button
If all is successful, it will cycle through your rows of login credentials, and export them to a file on your Desktop named pm_export.csv. It will close Safari's preferences dialog and open a dialog that tells you the export is complete. You can now convert that pm_export.csv file with the csv converter in version 1.11 of the conversion suite (also in Testing Bits).
Let me know if there are any issues.
Note - you may need to allow Script Editor to access Safari's UI elements. To do this, find the Security & Privacy area in System Preferences and allow Script Editor to control your computer:
0 -
thank you @MrC I'm grateful to you. i do it, i copied 474 line succesful :) (i had get just one error. yandex requested account permission at the last line and it caused to restart. if someone will use this first get yandex permission then start. for get this permission just click the yandex line ). my english is not well, i cant understand the converting csv to txt or another version, can i convert easily csv to excel file? thank you very much again :)))
0 -
Thank you again @MrC i do it with Numbers app now it is xlsx i hope you will go to heaven :)
0 -
That’s pretty good news for a start! Thanks for the feedback, and sorry for the delay.
I am curious about the Yandex error. Can you give me any more details about this (nothing confidential, of course)?
A CSV file is just a text file, that can be opened by any text editor, or more usefully, any spreadsheet program.
Hopefully I will remain on planet Earth for at least the foreseeable future.
0 -
I've updated the GetSafariPasswords script to:
- Clean up the Title (remove the protocol, and anything after the first / character).
- Ensure capture of the full URI as viewed when the cell is focused (vs the unfocused sanitized version shown with under non-focused/non-edit circumstances).
Due to (2) above, the script runs a bit slower, as each cell element now has to be focused to get the actual (vs. sanitized) values.
0 -
First off, my sincere thanks to @MrC to maintaining this forum and helping out everyone that asks!
I tried the AppleScript earlier in the thread, but failed with the error that does not allow iCould Keychain items to a local keychain "An error has occurred. Unable to add an item to the current keychain. One or more parameters passed to a function were not vaild." I was almost ready to give up, but I had 400+ items in my keychain I needed to move over; I didn't relish the idea of recreating each from within 1Password.Soooooo, long story shorter: after struggling with this for days I was finally able to copy out each of the iCould Keychain items using Automator. I created a script that opens each Keychain item one at a time, unlocks it, and copies/pastes each field out to TextEdit. From there I converted to csv and imported into 1Password. What a pain. Here is the code in case anyone else wants to use this as a starting point.
Notes:
- You must have TextEdit open on a new document and ready to receive the pasted info from the keychain.
- You must have the iCloud Keychain unlocked and sorted in whatever order you want to copy/paste.
- Update the "password" on line 73 to match yours.
- Add/update the keystroke order in the script to add more/less fields to each copy/paste action. I chose to the first field, username, and password to export. You might want more/less fields.
- You might have some instances where the delay's are not perfect, so pay attention to the output in TexEdit to make sure the data is coming across correctly.
- Once you get it the way you like it an are confident, increase the repeat value on line 1 to something like 50. I would not recommend more than that.
- Use at your own risk. If you know how to use AppleScript and Automator, then you might be just dangerous enough to screw things up. Good Luck!
repeat 1 times delay 0.2 tell application "Keychain Access" activate tell application "System Events" delay 0.2 keystroke return -- Press ⌘C to copy item title delay 0.2 keystroke "c" using command down end tell end tell --Switch to TextEdit delay 0.2 tell application "TextEdit" activate tell application "System Events" -- Press ⌘V delay 0.2 keystroke "v" using command down -- Type a comma delay 0.2 keystroke "," end tell end tell --Switch to Keychain tell application "Keychain Access" activate tell application "System Events" -- Press Tab x2 delay 0.1 keystroke tab delay 0.1 keystroke tab -- Press ⌘C delay 0.2 keystroke "c" using command down end tell end tell --Switch to TextEdit delay 0.2 tell application "TextEdit" activate tell application "System Events" -- Press ⌘V delay 0.2 keystroke "v" using command down -- Type ',' delay 0.2 keystroke "," end tell end tell --Switch to Keychain tell application "Keychain Access" activate tell application "System Events" -- Click the “Show password:” checkbox. delay 0.2 keystroke "c" using {shift down, command down} -- Type password - update to yours delay 0.5 keystroke "password" delay 0.2 keystroke return -- Close keychain item window delay 0.3 keystroke "w" using command down -- Go to next keychain item delay 0.2 key code 125 end tell end tell --Switch to TextEdit delay 0.2 tell application "TextEdit" activate tell application "System Events" -- Press ⌘V delay 0.2 keystroke "v" using command down -- Press Return delay 0.2 keystroke return end tell end tell end repeat end run
0 -
Thanks for the kind words.
Had you seen the GetSafariPasswords Applescript post above yours? It grabs Safari's passwords. Do you have many in iCloud Keychain that are not from Safari?
0 -
Just wanted to say thank you @MrC for making these scripts available. Using your instructions, I was very easily able to convert a KeePass2 file.
0 -
You are very welcome - enjoy 1Password!
0 -
On Mojave 10.14 when using the GetSafariPasswords script I get the following error despite having the passwords open an unlocked in safari: System Events got an error: Can’t get text field 1 of row 1 of table 1 of scroll area 1 of group 1 of group 1 of window 1 of application process "Safari". Invalid index.
0 -
Thanks @MrC for your work with all this, very kind of you to be willing to do so without even asking for donation.
Seems I've jumped into this into a time of transition with the new Mojave update – I wanted to take my iCloud Keychain passwords, export them from Safari/Keychain Access and plonk them into 1Password.
I've taken @moxiefrog 's script and tweaked it a tad so that it will work under macOS Mojave to export items from your iCloud Keychain to TextEdit so you can save as a CSV file and then import to 1Password. I think Mojave changed the order in which the Keychain Access application displays the item data? Anyways, run the script attached to the end of this post with the same instructions from @moxiefrog 's post from August 19 to export items from your iCloud Keychain to TextEdit under Mojave. From there, you can save the plain text file as a CSV and import the items into 1Password. This script copies the item name, url, username and password (so it can be used to autofill from 1Password once imported). I'll copy and past the instructions from @moxiefrog 's post just to make it easier:
- You must have TextEdit open on a new document and ready to receive the pasted info from the keychain.
- You must have the iCloud Keychain unlocked and sorted in whatever order you want to copy/paste.
- Update the "password" field on the line that's 33 lines from bottom of the script to match your password.
- You might have some instances where the delay's are not perfect, so pay attention to the output in TexEdit to make sure the data is coming across correctly.
- Once you get it the way you like it and are confident, increase the repeat value on line 1 to something like 50. I would not recommend more than that.
- Use at your own risk. If you know how to use AppleScript and Automator, then you might be just dangerous enough to screw things up. Good Luck!
Thanks @moxiefrog for making the script!
(Just for reference, I copied 74 items and it took about 5 minutes)repeat 1 times delay 0.2 tell application "Keychain Access" activate tell application "System Events" delay 0.2 keystroke return -- Press ⌘C to copy item title delay 0.2 keystroke "c" using command down end tell end tell --Switch to TextEdit delay 0.2 tell application "TextEdit" activate tell application "System Events" -- Press ⌘V delay 0.2 keystroke "v" using command down -- Type a comma delay 0.2 keystroke "," end tell end tell --Switch to Keychain tell application "Keychain Access" activate tell application "System Events" -- Press Tab x3 to get to item url delay 0.1 keystroke tab delay 0.1 keystroke tab delay 0.1 keystroke tab -- Press ⌘C delay 0.2 keystroke "c" using command down end tell end tell --Switch to TextEdit delay 0.2 tell application "TextEdit" activate tell application "System Events" -- Press ⌘V delay 0.2 keystroke "v" using command down -- Type ',' delay 0.2 keystroke "," end tell end tell --Switch to Keychain tell application "Keychain Access" activate tell application "System Events" -- Press Shift-Tab to get to item account name delay 0.1 keystroke tab using shift down -- Press ⌘C delay 0.2 keystroke "c" using command down end tell end tell --Switch to TextEdit delay 0.2 tell application "TextEdit" activate tell application "System Events" -- Press ⌘V delay 0.2 keystroke "v" using command down -- Type ',' delay 0.2 keystroke "," end tell end tell --Switch to Keychain tell application "Keychain Access" activate tell application "System Events" -- Click the “Show password:” checkbox. delay 0.2 keystroke "c" using {shift down, command down} -- Type password - update to yours delay 0.5 keystroke "password" delay 0.2 keystroke return -- Close keychain item window delay 0.3 keystroke "w" using command down -- Go to next keychain item delay 0.2 key code 125 end tell end tell --Switch to TextEdit delay 0.2 tell application "TextEdit" activate tell application "System Events" -- Press ⌘V delay 0.2 keystroke "v" using command down -- Press ',' to end the item delay 0.2 keystroke "," -- Press Return to start new item line delay 0.1 keystroke return end tell end tell end repeat end run
0 -
You're welcome. Good to hear you've made some progress. I'll get right on the script early next week.
I'd originally used the copy/delay/paste method, but found it very unreliable with out a very long delay for each item, so wanted to find another way which was far quicker (and didn't involve user's having to potentially adjust delay times, multiple times to get the script to work reliably). And of course directly accessing the elements is the better, reliable method... so long as Apple doesn't adjust the interface! Doh.
0