Import Firefox Password Manager into Lastpass
I had tried to jump on to the cloud password manager band wagon last year with Lastpass but it was a spectacular failure. I installed the Lastpass Firefox plugin, it asked me if I wanted to import all my existing usernames and passwords, then it identified everything to import, failed to import them into my Lastpass vault and deleted all the usernames and passwords from my Firefox Password Manager. Luckily I had backed up my Firefox profile before doing anything, phew!
The company I'm contracting with at the moment uses Lastpass so I have been using it there and thought it was about time I properly went for it again in MrN land. It wasn't as straightforward as I would have liked but the process I have declined is simple. Well simple if you are a developer with various GitHub related tools installed, various developer software packages installed and a familiarity with the Unix command line ;)
First up, sign up for a Lastpass:
https://lastpass.com/create-account.php
and install the Firefox plugin
https://addons.mozilla.org/en-US/firefox/addon/lastpass-password-manager/
It installed and on this occasion it didn't ask me if I wanted to import my passwords. I was secretly pleased as that had been the problem last time. Lastpass allowed you to import credentials from other well known manager types but not Firefox Password Manager. A bit of Google indicates that this is by design and part of Firefox's security model: no plugins of code gets access to the usernames and passwords, so it makes sense when you think about it.
The closest option is to export the credentials from Firefox as CSV and import them into Lastpass as a generic import. So here goes:
You've installed git and NodeJs right?
mrn@example git $ git clone https://github.com/kspearrin/ff-password-exporter.git
Cloning into 'ff-password-exporter'...
remote: Enumerating objects: 140, done.
remote: Total 140 (delta 0), reused 0 (delta 0), pack-reused 140
Receiving objects: 100% (140/140), 135.55 KiB | 351.00 KiB/s, done.
Resolving deltas: 100% (82/82), done.
Build the software
mrn@example git $ cd ff-password-exporter/
mrn@example ff-password-exporter (master) $ npm install
> fsevents@1.2.4 install /Users/mrn/Development/git/ff-password-exporter/node_modules/fsevents
> node install
[fsevents] Success: "/Users/mrn/Development/git/ff-password-exporter/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> electron@3.0.6 postinstall /Users/mrn/Development/git/ff-password-exporter/node_modules/electron
> node install.js
and run it
mrn@example ff-password-exporter (master) $ npm run electron
> ff-password-exporter@0.0.0 electron /Users/mrn/Development/git/ff-password-exporter
> electron --inspect=5858 ./src --watch
Debugger listening on ws://127.0.0.1:5858/83577868-eb62-4f2e-9717-17c910bf901b
For help, see: https://nodejs.org/en/docs/inspector
Electron could not be found. No hard resets for you!
It launches a little graphical user interface asking you to direct it at a Firefox profile path. After saving you will get a CSV file is called firefox_logins_20190627000009.csv
(or whatever) which looks like this
hostname,username,password,timeCreated,timeLastUsed,timePasswordChanged,timesUsed
https://www.example.com,mrn@example.com,armadillo,1482355671960,1561490114251,1482355671960,7
We need to change that into a format that Lastpass can understand. This works on Unix based OSs. If you are using Windows then maybe you can borrow a Mac ;)
It's pretty much one line! Love you unix kiss kiss.
d="Imported on `date`"
cut -f1-3 -d, firefox_logins_20190627000009.csv | \
sed 's/\([^,]*\),/\1,\1,/' | \
sed 's/^hostname,hostname,/name,url,/' | \
sed 's>^http://>>' | \
sed 's>^https://>>' | \
sed 's/^/Imported,/' | \
sed 's/^Imported,name,url/folder,name,url/' | \
sed "s/^/$d,/" | \
sed "s/^$d,folder,/notes,folder,/" > firefox_logins_20190627000009_lastpass.csv
So stepping through the lines, take the first 3 column as separated by a comma from the file firefox_logins_20190627000009.csv
and we send that down the pipe. The file stream is read out and the first column is duplicated and given a the title of "name". The leading protocols are removed. (If anyone can join these together then please add a comment.) Next we add a new column at the from called "Imported" and change the title to "folder". Finally we add another column to the front called notes which gives us a marker specifying when the import took place (or by who) and change the column's title.
This will give us a file called firefox_logins_20190627000009_lastpass.csv
which looks like this:
notes,folder,name,url,username,password
Imported on Thu 27 Jun 2019 01:04:35 BST,imported,www.example.com,https://www.example.com,mrn@example.com,armadillo
Import CSV into Lastpass
Go to my vault in Lastpass Firefox plugin. On left at the bottom click through More Options... > Advanced > Import. Select Generic CSV File and click Import. Select the file firefox_logins_20190627000009_lastpass.csv
.
You will be forwarded to the Lastpass web site and shown a form with checkboxes next time all the passwords in the import file. Click Import All. A handy progress bar pops up and finishes with inviting you to open your Lastpass vault. All the passwords can be found in the Imported folder.
When you are happy with the transfer you can start deleting the credentials from Firefox. You can go through this procedure on each of your browsers. When you import more CSVs ensure that you check the merge duplicates to make sure you are not doubling up.
No feedback yet
Form is loading...