X
Tap here to go to the mobile version of the site.

Support Forum

How do I export "saved logons"?

Posted

Between two Win10 Home PCs, both used to have all my Saved Logons, but somehow one PC has dropped them all. Both PCs do use Firefox Sync between successfully, but while that synchronizes Bookmarks (& whatever else), evidently NOT "Saved Logons". So, isn't there some way to EXPORT all of them to a file, to then IMPORT them to my other PC? Incidentally, within Saved Logons, there is a button named IMPORT, but it's used is only for importing from 3 other designated browsers, and apparently on the self-same PC. Searching Firefox Support was a waste of time ... their 'results' are just wide nets of hundreds of irrelevant things, no matter how precise I attempt each search. Bad support job on self-help, Mozilla.

Between two Win10 Home PCs, both used to have all my Saved Logons, but somehow one PC has dropped them all. Both PCs do use Firefox Sync between successfully, but while that synchronizes Bookmarks (& whatever else), evidently NOT "Saved Logons". So, isn't there some way to EXPORT all of them to a file, to then IMPORT them to my other PC? Incidentally, within Saved Logons, there is a button named IMPORT, but it's used is only for importing from 3 other designated browsers, and apparently on the self-same PC. Searching Firefox Support was a waste of time ... their 'results' are just wide nets of hundreds of irrelevant things, no matter how precise I attempt each search. Bad support job on self-help, Mozilla.

Chosen solution

https://www.ghacks.net/2018/07/18/how-to-export-firefox-passwords-in-firefox-57/ ++++++++++++++++++++++++++++++++++++ http://www.nirsoft.net/utils/passwordfox.html (Win) PasswordFox v1.58 - Extract the usernames/passwords stored in Firefox Copyright (c) 2008 - 2017 Nir Sofer

Note: Some anti-virus show false positive. ++++++++++++++++++++++++++++++++++ Easily export your passwords from Firefox. https://github.com/kspearrin/ff-password-exporter

Export your passwords from Firefox in a portable CSV or JSON format. It works on Windows, macOS, and Linux. +++++++++++++++++++++++++++++++++++ 3 Tools to Decrypt and Recover Passwords Saved in Firefox • Raymond CC https://www.raymond.cc/blog/how-to-find-hidden-passwords-in-firefox/ +++++++++++++++++++++++++++++++++++ https://www.ghacks.net/2018/07/18/how-to-export-firefox-passwords-in-firefox-57/ ++++++++++++++++++++++++++++++++++++ https://github.com/kspearrin/ff-password-exporter

Read this answer in context 1
Quote

Additional System Details

Installed Plug-ins

  • Shockwave Flash 32.0 r0

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

More Information

jscher2000
  • Top 10 Contributor
8517 solutions 69606 answers

Helpful Reply

Actually, there is no feature to export/import saved logins, so the fact that you didn't find an answer has a good basis.

Sync should work if logins are a selected category. However, before changing any Sync settings, I suggest making a backup of your profile, where Firefox stores your browser data. I'll give a link to an article on that further below.

One option to transfer your saved logins would be to copy a pair (or trio) of files from one PC to the other. Those files are:

  • logins.json
  • key4.db
  • key3.db (legacy file, may not be needed)

Those files are stored in your currently active Firefox profile folder. These articles describe how to find that folder and what it contains. On the receiving Firefox, you'll want to exit out before replacing in-use files.

References:

Actually, there is no feature to export/import saved logins, so the fact that you didn't find an answer has a good basis. Sync should work if logins are a selected category. However, before changing any Sync settings, I suggest making a backup of your profile, where Firefox stores your browser data. I'll give a link to an article on that further below. One option to transfer your saved logins would be to copy a pair (or trio) of files from one PC to the other. Those files are: * logins.json * key4.db * key3.db (legacy file, may not be needed) Those files are stored in your currently active Firefox profile folder. These articles describe how to find that folder and what it contains. On the receiving Firefox, you'll want to exit out before replacing in-use files. ''References:'' * [[Profiles - Where Firefox stores your bookmarks, passwords and other user data]] * [[Back up and restore information in Firefox profiles]] * [[Recovering important data from an old profile]] * https://support.microsoft.com/en-us/help/14201/windows-show-hidden-files
Was this helpful to you? 1
Quote
FredMcD
  • Top 10 Contributor
4149 solutions 57924 answers

Chosen Solution

https://www.ghacks.net/2018/07/18/how-to-export-firefox-passwords-in-firefox-57/ ++++++++++++++++++++++++++++++++++++ http://www.nirsoft.net/utils/passwordfox.html (Win) PasswordFox v1.58 - Extract the usernames/passwords stored in Firefox Copyright (c) 2008 - 2017 Nir Sofer

Note: Some anti-virus show false positive. ++++++++++++++++++++++++++++++++++ Easily export your passwords from Firefox. https://github.com/kspearrin/ff-password-exporter

Export your passwords from Firefox in a portable CSV or JSON format. It works on Windows, macOS, and Linux. +++++++++++++++++++++++++++++++++++ 3 Tools to Decrypt and Recover Passwords Saved in Firefox • Raymond CC https://www.raymond.cc/blog/how-to-find-hidden-passwords-in-firefox/ +++++++++++++++++++++++++++++++++++ https://www.ghacks.net/2018/07/18/how-to-export-firefox-passwords-in-firefox-57/ ++++++++++++++++++++++++++++++++++++ https://github.com/kspearrin/ff-password-exporter

https://www.ghacks.net/2018/07/18/how-to-export-firefox-passwords-in-firefox-57/ ++++++++++++++++++++++++++++++++++++ http://www.nirsoft.net/utils/passwordfox.html (Win) PasswordFox v1.58 - Extract the usernames/passwords stored in Firefox Copyright (c) 2008 - 2017 Nir Sofer Note: Some anti-virus show false positive. ++++++++++++++++++++++++++++++++++ Easily export your passwords from Firefox. https://github.com/kspearrin/ff-password-exporter Export your passwords from Firefox in a portable CSV or JSON format. It works on Windows, macOS, and Linux. +++++++++++++++++++++++++++++++++++ 3 Tools to Decrypt and Recover Passwords Saved in Firefox • Raymond CC https://www.raymond.cc/blog/how-to-find-hidden-passwords-in-firefox/ +++++++++++++++++++++++++++++++++++ https://www.ghacks.net/2018/07/18/how-to-export-firefox-passwords-in-firefox-57/ ++++++++++++++++++++++++++++++++++++ https://github.com/kspearrin/ff-password-exporter
Was this helpful to you? 1
Quote
cor-el
  • Top 10 Contributor
  • Moderator
17278 solutions 156183 answers

In Firefox 67 you can possibly use Lockwise (formerly named Lockbox) to share the passwords using a Firefox Sync account (2.2.0 is for 67+, older 2.1.0 for 63+).

See also:


Note that you can use code in the Browser Console to export and import passwords.

See these replies for possible alternatives using the Browser Console to run JavaScript code.


Code for Firefox 52+:

/* EXPORT to firefox-logins.json - Firefox 52 and later */

async function exportSignons (aPath, bytes){
 await OS.File.writeAtomic(aPath, bytes);
}

var tokendb = Cc["@mozilla.org/security/pk11tokendb;1"].createInstance(Ci.nsIPK11TokenDB);
var token = tokendb.getInternalKeyToken();

try {token.login(true)} catch(e) {Cu.reportError(e)}

if (!token.needsLogin() || token.isLoggedIn()) {
 var passwordmanager = Cc["@mozilla.org/login-manager;1"] .getService(Ci.nsILoginManager);
 var signons = passwordmanager.getAllLogins({});
 var json = JSON.stringify(signons, null, 1);

 var ps = Services.prompt;
 var txt = 'Logins: ' + signons.length;
 var obj = new Object; obj.value = json;

 if (ps.prompt(null, 'Logins - JSON', txt, obj, null, {})){
 var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
 fp.init(window,"",Ci.nsIFilePicker.modeSave);
 fp.defaultString = "firefox-logins.json";

 fp.open((rv) => {
 if (rv == Ci.nsIFilePicker.returnOK || rv == Ci.nsIFilePicker.returnReplace) {
 let bytes = new TextEncoder().encode(json);
 exportSignons(fp.file.path, bytes);
 }})
} else {console.log("<canceled>");} }

/* IMPORT from JSON file - Firefox 52 and later */

async function importSignons(sgFilePath){ /*[52+]*/
let bytes = await OS.File.read(sgFilePath);
let data = JSON.parse(new TextDecoder().decode(bytes));
ImportLogins(data);
}

function ImportLogins (logins){ /*[42+]*/
try { /*[60+]*/
 ChromeUtils.import("resource://gre/modules/LoginHelper.jsm");
 LoginHelper.maybeImportLogins(logins);
} catch(e) {/*[42-59]*/
 Cu.import("resource://gre/modules/LoginHelper.jsm");
 for (i in logins) LoginHelper.maybeImportLogin(logins[i]);
}
}

var fu = Cu.import("resource://gre/modules/FileUtils.jsm").FileUtils;
var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);

fp.init(window, "Open File", Ci.nsIFilePicker.modeOpen);
fp.appendFilter(".json JSON Files","*.json");

fp.open((aResult) => {
  if (aResult == Ci.nsIFilePicker.returnOK) {
  if (fp.file.exists() && fp.file.isFile() && fp.file.isReadable()) {
    var signonfile = fp.file.path;
    try {
     importSignons(signonfile);
     console.log("<async import>");
    }
    catch (err) {console.log(err);}
  }
  } else {console.log("<canceled>");}
})
In Firefox 67 you can possibly use Lockwise (formerly named Lockbox) to share the passwords using a Firefox Sync account (2.2.0 is for 67+, older 2.1.0 for 63+). *https://github.com/mozilla-lockwise/lockwise-addon/releases/ *https://mozilla-lockwise.github.io/faq.html See also: *[[/questions/1257565]] Where do I find Lockbox for my Firefox PC browser? ---- Note that you can use code in the Browser Console to export and import passwords. *https://developer.mozilla.org/en-US/Tools/Browser_Console See these replies for possible alternatives using the Browser Console to run JavaScript code. *[[/questions/1239821#answer-1171958]] Will Saved Password Editor ever work again? *[[/questions/1195733#answer-1053091]] Is it possible to export the saved passwors to HTLM? ---- Code for Firefox 52+: <pre><nowiki> /* EXPORT to firefox-logins.json - Firefox 52 and later */ async function exportSignons (aPath, bytes){ await OS.File.writeAtomic(aPath, bytes); } var tokendb = Cc["@mozilla.org/security/pk11tokendb;1"].createInstance(Ci.nsIPK11TokenDB); var token = tokendb.getInternalKeyToken(); try {token.login(true)} catch(e) {Cu.reportError(e)} if (!token.needsLogin() || token.isLoggedIn()) { var passwordmanager = Cc["@mozilla.org/login-manager;1"] .getService(Ci.nsILoginManager); var signons = passwordmanager.getAllLogins({}); var json = JSON.stringify(signons, null, 1); var ps = Services.prompt; var txt = 'Logins: ' + signons.length; var obj = new Object; obj.value = json; if (ps.prompt(null, 'Logins - JSON', txt, obj, null, {})){ var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); fp.init(window,"",Ci.nsIFilePicker.modeSave); fp.defaultString = "firefox-logins.json"; fp.open((rv) => { if (rv == Ci.nsIFilePicker.returnOK || rv == Ci.nsIFilePicker.returnReplace) { let bytes = new TextEncoder().encode(json); exportSignons(fp.file.path, bytes); }}) } else {console.log("<canceled>");} } </nowiki></pre> ---- <pre><nowiki> /* IMPORT from JSON file - Firefox 52 and later */ async function importSignons(sgFilePath){ /*[52+]*/ let bytes = await OS.File.read(sgFilePath); let data = JSON.parse(new TextDecoder().decode(bytes)); ImportLogins(data); } function ImportLogins (logins){ /*[42+]*/ try { /*[60+]*/ ChromeUtils.import("resource://gre/modules/LoginHelper.jsm"); LoginHelper.maybeImportLogins(logins); } catch(e) {/*[42-59]*/ Cu.import("resource://gre/modules/LoginHelper.jsm"); for (i in logins) LoginHelper.maybeImportLogin(logins[i]); } } var fu = Cu.import("resource://gre/modules/FileUtils.jsm").FileUtils; var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); fp.init(window, "Open File", Ci.nsIFilePicker.modeOpen); fp.appendFilter(".json JSON Files","*.json"); fp.open((aResult) => { if (aResult == Ci.nsIFilePicker.returnOK) { if (fp.file.exists() && fp.file.isFile() && fp.file.isReadable()) { var signonfile = fp.file.path; try { importSignons(signonfile); console.log("<async import>"); } catch (err) {console.log(err);} } } else {console.log("<canceled>");} }) </nowiki></pre>

Modified by cor-el

Was this helpful to you? 1
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.