Padlock and code image

Some time back, I wrote a post listing the steps required to migrate passwords stored in Chrome to Firefox

That post was a bit convoluted, so this post is hopefully an improvement!  My intention is to make this process as simple, and reliable, as possible.  To succeed, you will need:

There are five main steps.  Let’s get started!

  1. In Chrome’s address bar, paste:
    chrome://flags/#password-import-export

    …then hit enter.

    Chrome flag screenshot
    The option in Chrome should appear like this. Enable it!

    In the option that is highlighted, Select Enabled and then Relaunch.

  2. Now, in Chrome, navigate to chrome://settings-frame/passwords, scroll down and click Export.  Save the file with a .csv extension.
  3. Locate the CSV file and right click > Open With > LibreOffice Calc (Alternatively, start LibreOffice Calc and open the CSV file).
  4. Using LibreOffice Calc, you will need to modify the CSV file to import it into Firefox.  Do the following:
    1. Right-click on row 1 and select ‘Insert Rows Above’.  This should insert a single row at the top of the sheet.
    2. Copy the following and paste into cell A1, using Shift-Ctrl-V (to ensure you paste as plain text):
      # Generated by Password Exporter; Export format 1.0.4; Encrypted: false
    3. You need to move one column, B, to where column D is – but we don’t want to overwrite your data!
      • At the top of column B, right-click and select Cut.
      • Then right-click again and select Delete Columns – this should remove the now-empty column, and shift-left columns C and D, to positions B and C.
      • Now, on column D, select Paste.  Your url data should now live in column D.
    4. Paste the following into cell A2, using Shift-Ctrl-V:
      hostname username password formSubmitURL httpRealm usernameField passwordField

      When pasting, you may be prompted to select the data format.  Select “Unformatted Text” in the list and click OK.  We are ok with overwriting other cell contents, so “OK” that.  Note, you may need to separate out the headings into columns, left to right.

    5. Finally, we’re ready to export this data!  Go to the File menu, select Save As…In the Save As requester that appears, at the bottom check ‘Edit Filter’ and select ‘Text CSV (.csv)’ in the format drop-down:

      Select these options to correctly export your data!
      Select these options to correctly export your data!
    6. Before we get too excited, there’s just one more step to perform – some textual clean-up!Open up the exported CSV file in your favourite plain-text editor.  In the first row, you may see this:
      "# Generated by Password Exporter; Export format 1.0.4; Encrypted: false",,,,,,

      Delete the leading ” and trailing “,,,,,, from that line.

      Secondly, do a Find/Replace on double-commas (,,) making them ,””,  (with two quotes inserted) instead.  You may need to perform this Find/Replace twice.  Now save the file again.

  5. In Firefox, click on the burger menu and select Add-ons (or just go to about:addons).  Find Password Exporter and click Preferences.  In the Preferences window, click Import Passwords.  Now locate your saved CSV file and load it.You should finally see something like this:

    Importing saved passwords into Firefox. Not easy, but definitely rewarding!
    Importing saved passwords into Firefox. Not easy, but definitely rewarding!

 

4 thoughts on “Updated: Import Chrome passwords into Firefox

  1. This post has a new edition.
    Part #1 of the Data Liberation series
    Although Google Chrome is a very fast browser, it lacks one key feature which seems designed to lock users in – any account migration facilities to support moving to other browsers.  This post is intended to help you move your saved passwords from Chrome to Firefox.
    Firstly, you’ll need to have a read of this page: http://blog.catoblepa.org/2012/08/linux-how-to-export-google-chrome_28.html   – then come back here for more info!
    While following the instructions in that post, take note of these steps below before you close your browser. If you have also set up a separate encryption password for your browser, don’t worry – this method still allows access.

    Disconnect Google account in Settings
    In Chrome settings, as a precation, I disconnected my Google account before closing the browser. Therefore, any changes I could make to this temporary session wouldn’t ever be uploaded back to Google.
    Once you have the saved CSV file from Chrome, keep hold of it – we need to edit it. In Firefox, install the Password Exporter add-on: https://addons.mozilla.org/en-US/firefox/addon/password-exporter/?src=search

    Exporting passwords
    Password Exporter allows you to import passwords too, so you can avoid the need to install any third-party workarounds like LastPass (which again require you to upload all your browser data).Firstly, though, using Password Exporter in Firefox (Tools > Add ons … Extensions > Password Exporter > Preferences), we can export a sample CSV file to see how Password Exporter expects its import data. Simply click “Export Passwords” and save the file to your home directory.
    NOTE: This requires that at least one password is saved in Firefox already.
    The headings in the exported file are as follows:
    hostname username password formSubmitURL httpRealm usernameField passwordField
    This is the format that Password Exporter will expect its import data.
    The data’s headings that you have just exported from Chrome are a little different:
    origin_url action_url username_element username_value password_element password_value submit_element signon_realm ssl_valid preferred date_created blacklisted_by_user scheme password_type possible_usernames times_used
    We need to match up the firefox CSV headings with the corresponding Chrome CSV headings. To do this quickly, use a spreadsheet tool I used LibreOffice Calc.
    This is what I arrived at:
    (FF = Firefox; GC = Google Chrome)
    FF: hostname username password formSubmitURL httpRealm usernameField passwordFieldGC: origin_url username_value password_value action_url signon_realm username_element password_element
    Once the fields are mapped, there’s a couple more important steps to undertake.
    Export in the right format!
    Firstly, when you come to exporting from your spreadsheet application, make sure you choose to edit the output filter. In the Export Text File dialog, make sure “Quote all text cells” does not have a check (tick) in the box.
    For good measure, I also selected ASCII/US in encoding type,  as that is the format used by Password Exporter when exporting.   I think the importer should handle ISO-8859-1 and/or UTF-8, but your mileage may vary.
    Now export it.
    Remember seeing the additional header in the exported CSV file? It might have looked something like this:

    Generated by Password Exporter; Export format 1.1; Encrypted: false

    In order to tell Password Exporter what format to expect its data in, this heading needs to be added back. However… the best way to do this is via a text editor, not in a spreadsheet program.
    Open up GEdit, Emacs, Vi… whatever. Add that line to the top, but remove any trailing commas! It should now look like this:
    # Generated by Password Exporter; Export format 1.0.4; Encrypted: false
    "hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"

    One more step before you import!
    A side-effect of exporting your CSV in LibreOffice is that empty cells are not quoted. In other words, the comma-separated values may appear like this:
    "someusername","somepassword","someUrl",,"someusernameField"
    Did you see those two commas with nothing between? The Password Exporter won’t like that when trying to import, so do a quick search-and-replace:
    Search for ,, and replace with ,””,
    Finally, save the file.  Again, ENSURE the file type is US/ASCII.
    Successfully importing passwords!
    Now open up the Password Exporter dialog from Firefox and click Import Passwords – you should see progress in the dialog shortly.
    CAVEAT #1: BUG WHEN IMPORTING v1.2-EXPORTED DATA
    There is an import bug when the version header is declared as 1.1. However, you can get around this by “fudging” the import header to an older version (I used 1.0.4). If you have trouble importing, adjust your header in the file to look like this:
    "hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"
    After importing, you may see that not all passwords were imported. This is because duplicates are not imported. You can view the details in the link.
    CAVEAT #2: SOME LOGINS, PASSWORDS, ETC ARE QUOTED
    So far I’ve not had time to find a way around this. It’s to do with the import format.
    The adventurous can investigate the source code, here: https://github.com/fligtar/password-exporter/blob/master/passwordexporter/chrome/content/pwdex-loginmanager.js
    Hopefully you have now successfully liberated your passwords!
    Problems?  Comment below!
    Last updated by at November 15, 2016.Sharing is scaring…GoogleTwitterRedditPinterestTumblrPocketEmailTelegramWhatsAppMoreFacebookLinkedInSkypePrintLike this:Like Loading…

    <em>Related</em>

  2. Thank you Steve — I wish I’d found this page ages ago. You’re actually writing a bit of technical support for the Password Exporter plugin, which has got a couple of one-star reviews because people haven’t formatted the csv file properly, perhaps expecting csv to be an unchanging template style of file rather than the much more customisable thing it is.

    Thanks again, I can get on with things now 🙂

Have your say!