Help transferring items from iCloud Keychain

2»

Comments

  • MrC
    MrC
    Volunteer Moderator

    It occurred to me tonight how I can simulate a large keychain. I’ll test this idea in the morning.

  • MrC
    MrC
    Volunteer Moderator
    edited May 2021

    @JDail

    I've updated the script in the Custom folder. It removes the 2 second delay mentioned above and instead replaces it with some code that retries obtaining the row data after the passwords are unlocked. The code will re-read the data until maxAttempts (defined at the top of the script) is reached, or the row count is not zero, and two consecutively consistent row counts are obtained (with a 1 second interval each read).

    I also added code to allow me (or others) to simulate arbitrary data set sizes (this can be larger or smaller than the list of Safari passwords). This allowed me to test a sufficient large sample set larger, allowing the script to run for 1000 or more seconds. I ran the script twice, on two different Macs, using 1000 (virtual) entries, with VoiceOver enabled. It completed successfully on all runs.

    Finally, there is some more logging, for future debugging, and log debugging is on by default until we're satisfied with the result.

    The script is ready for you to try to export your Safari passwords now. Just remember to allow it to run, uninterrupted, until it completes. On my two different Mac's (2019 iMac / 2016 Macbook Pro), it took about 1 second / entry w/VoiceOver enabled. @Joshua_ag mentioned his runs took nearly 2 seconds / entry without VoiceOver, and about 2.4 seconds with (a Macbook Air, if I recall, and it was also doing screen recording at the time).

    Unfortunately, there's not much I can do to reduce this time, since most of it is spent a) opening / closing the "sheets" that show the password data, and b) VoiceOver does add some overhead. Good thing not many people have to run the script more than once!

    CC: @Joshua_ag

  • JDail
    JDail
    Community Member

    Hi,
    I tried to run the script as it was just now, and of my over 400 items, only like 45 were exported.
    The next steps that I need to figure out, is how to convert the file, because the current version of the script is not letting me do it.

  • Hi @JDail,

    That's very odd that the script didn't work to export all of your items. When I tried doing it with over 500 items it worked to export all of them. There should have been a log file saved to your desktop titled "get_safari12_passwords.log" can you read that file and see how many items it is reporting you have? The row count is how many items it detects.

  • JDail
    JDail
    Community Member

    Hi,
    So what do I do? How do I get the newest version of the script? Also, how do I create a new topic?

  • @JDail

    You can create a new topic in any group by clicking the "New Discussion" button.

    Here's how to get the newest version of the script:
    1. Go to the announcement post for MrC's convert suite and open the dropbox link: https://1password.community/discussion/101693/moving-to-1password-from-another-password-manager
    2. On Dropbox, open the folder titled "Custom".
    3. Download the file titled "Get_Safari12_Passwords.applescript".
    5. Open the file titled "Get_Safari12_Passwords.applescript".

    You can confirm if it is the newest one if the top 15 lines match what I pasted below.

    -- Exports Safari's saved passwords to a CSV file formatted for use with the csv converter in the mrc-converter-suite 
    --
    -- Copyright 2021 Mike Cappella (mike at cappella dot us)
    
    use AppleScript version "2.5" -- runs on 10.11 (El Capitan) and later               
    use scripting additions
    
    -- Maximum amount of time to allow Safari to process password data
    property extractionTimeout : 30 * 60 -- 30 minutes
    
    -- Maximum number of tries (once per second) for reading password table row data.
    -- It can take a few seconds for Safari to populate the password table, esp. when VoiceOver
    -- is enabled, or the system is running slowly.
    -- The table's row count is sampled until two consistent row counts are obtained, or maxAttempts
    property maxAttempts : 10
    

    Let me know how that goes for you.

  • JDail
    JDail
    Community Member

    Hi,
    I ran the script mentioned above, and according to the log file, it only exported 206 items. I’m not sure how to tell how many should be in my keychain, but I know there’s probably more than that.
    What can I do to get the ones that are missing?

  • MrC
    MrC
    Volunteer Moderator
    edited May 2021

    @JDail

    At the top of the log, there is a line that indicates how many entries are present in the Safari passwords list. It will read like this:

    0014:  Processing 14 rows from the passwords dialog
    

    Pleas post that entire line.

    Also, please post the entire line that looks like:

    0026: Leaving FetchEntries(): entries found: 14
    
  • JDail
    JDail
    Community Member

    Hi,
    I just read through the log file, & it said that 206 items were exported. At the end of the same line though, was a -1.
    What does this negative number indicate?
    Is there a way for voiceOver to tell me how many items are in my keychain, that way, I can ensure I'm not missing anything?

  • JDail
    JDail
    Community Member

    Hi,
    I just read through the log file, & the top line said 206 items were exported, however, as discussed previously, I know i have over 400.
    How can I make sure I get them all?
    Is there a way for voiceover to tell me how many items are in my keychain?

  • JDail
    JDail
    Community Member

    Hi,
    I read the log file, and it said only 206 items were exported.
    However, as discussed previously, I think I have over 400.
    So, how can i get the rest of them?

  • JDail
    JDail
    Community Member

    Hi,
    I read the log file, and it said only 206 items were exported.
    However, as discussed previously, I think I have over 400.
    So, how can i get the rest of them?

  • JDail
    JDail
    Community Member

    Hi,
    I just read through the log file, & it said that 206 items were exported. At the end of the same line though, was a -1.
    What does this negative number indicate?
    Is there a way for voiceOver to tell me how many items are in my keychain, that way, I can ensure I'm not missing anything?

  • JDail
    JDail
    Community Member

    Hi,
    I read the log file, & it said only 206 items were exported, so how can I grab the rest?
    How can I tell how many items I have?

  • JDail
    JDail
    Community Member

    Hi,
    I just read through the log file, & it said that 206 items were exported. At the end of the same line though, was a -1.
    What does this negative number indicate?
    Is there a way for voiceOver to tell me how many items are in my keychain, that way, I can ensure I'm not missing anything?

  • @JDail

    I was able to use VoiceOver to say how many rows were in the list of logins in Safari. Here's how I did it.
    1. Open Safari.
    2. Open Safari Preferences
    3. Go to Passwords & unlock.
    4. Go into the passwords table and select a cell (VoiceOver told me a cell was selected and then started reading the contents).
    5. Press command and the letter a on your keyboard, to select all rows.

    At that point VoiceOver gave me a number and said "rows selected" (for example with the test data I have in iCloud Keychain it said "539 rows selected"). The same number that I heard VoiceOver say is the same number I imported into iCloud Keychain and the same number MrC's exporter reported getting out of iCloud Keychain.

    That's what I did, however trying to figure out exactly how many logins you have in iCloud would be a great question for Apple Support, since they would know more about their apps and services and I know more about 1Password.

  • MrC
    MrC
    Volunteer Moderator
    edited May 2021

    @JDail

    Also, I'd like to see the two log lines, in their entirety, that I requested above. There are time stamps I'd like to know.

    Also, if you can post these lines, that might be informative too:

    0026: Entering write_csv_file()
    0026:   Writing CSV string to file: length: 615
    0026:   Done
    0026: Leaving write_csv_file()
    

    You will have different numbers (time stamps) preceding those lines; that is what I need to see.

    All of your iCloud Keychain data can be accessed via the Keychain Access utility, but even in the Passwords area it will present many extraneous items that you don't care about, so you have to sort by "Kind" and count the "Web form passwords" entries.

This discussion has been closed.