Opening a .sqlite from a backup on 1Password 6

Options
mmznrksh
mmznrksh
Community Member

Hi, please excuse if this is a duplicate; I've searched extensively in the forums, can't find a close match.

I'm trying to use 1Password 6.3.1 on my MacOS desktop to open a .sqlite file from an old MacOS 1Password (likely 3.x or 4.x, I'm afraid I'm not sure exactly where I was in the upgrade cycle at the time I backed the file up) - I just have have a context-free OnePassword.sqlite file in an my backup. Ideally, I'd open this as a new vault and move the information I care about to my primary vault (avoiding any conflicts). I recall restoring from backed-up sqlite files easily in the past, but I don't see an easy way in the "Import" (expects a .1pif file) or "Restore" (expects a .1p4_zip file) menu items. I've tried compressing the .sqlite file and changing the extension of the resulting zip archive to "1p4_zip," riffing off some info in the forums, but receive a silent failure using the "Restore" > "Add backup" option in the app, or "Failed adding S1.sqlite.1p4_zip" when double-clicking from the Finder.

Any and all suggestions for identifying and accessing the .sqlite file would be extremely welcome.

Thank you!


1Password Version: 6.3.1
Extension Version: Not Provided
OS Version: 10.11.5
Sync Type: Not Provided

Comments

  • Drew_AG
    Drew_AG
    1Password Alumni
    Options

    Hi @mmznrksh,

    Sorry to hear you're having trouble restoring your data from that older sqlite file! We'll do our best to help you out with that. As long as there aren't any problems with that OnePassword.sqlite file, it should be possible to restore your data from it one way or another.

    Ideally, I'd open this as a new vault and move the information I care about to my primary vault (avoiding any conflicts).

    The OnePassword.sqlite file is a database which contains all the 1Password vaults on your Mac as well as other data, so even if it actually contains one vault, you won't be able to simply open/add it to 1Password as an additional vault (that will only work if you have a .agilekeychain or .opvault file, which represents a single vault). But you should be able to use the sqlite file similarly to a regular backup file. It'll just take a few extra steps.

    Before doing anything else, you should make a new backup of your current 1Password data by opening the main 1Password app and going to File > Backup. That will open the Backup preferences and show all your backups, including the new one you just made.

    I've tried compressing the .sqlite file and changing the extension of the resulting zip archive to "1p4_zip," riffing off some info in the forums, but receive a silent failure using the "Restore" > "Add backup" option in the app

    That should actually work, but the file name also needs to be in a specific format. Try that again (zipping the sqlite file), and then change the file name and extension to the following:

    1Password 2016-07-14 10_51_17 (1 profiles, 1 items, 0 folders, 0 attachments).1p4_zip

    It doesn’t actually matter what the specific numbers are, so you don't need to change the date & time or number of profiles/items/etc - you can simply use that exact string. Once you've done that, go to Preferences > Backup > Find Backup in the 1Password app and select that backup file. Now it should appear in the list of backups (it might not necessarily be the most recent one shown there), so you can try restoring from it.

    If that works, you should be able to unlock 1Password and see your older data (if you've ever changed your master password, you might need to enter an older one).

    At this point, you'll need to extract the older data, then restore your current data and add the old data as a secondary vault. There are a couple ways to do that, and I think this will be the easiest:

    1. Go to 1Password > Preferences in the menubar, then choose the Sync tab.
    2. Choose Folder from the “Sync Primary vault with” pop-up menu.
    3. Click the Choose button, then select the Desktop (and click Open).
    4. Click Create New to save a new .opvault file to the Desktop.
    5. If you happen to see multiple vaults listed on the left side of the Sync preferences, follow the above steps for each one.
    6. Go to Preferences > Backup and restore from the most recent backup containing your current data.
    7. Once your current data has been restored, find the new .opvault file on the Desktop and double-click on it (1Password should prompt you to add it as a new vault).

    If all goes well, you should have your current data back in the Primary vault, and you should have a secondary vault with the older data from that older sqlite file. You can move or copy the items you need from the secondary vault to your Primary vault.

    Please let us know how it all goes and if you have any questions or run into any trouble with that. Thanks! :)

  • mmznrksh
    mmznrksh
    Community Member
    Options

    Drew_AG: Fantastic; this did the trick!

    Two small notes (for tinkerers like me screwing around with this stuff in the future and read this post):

    1: the contents of the 1p4_zip file must still contain the backup sqlite file correctly named: "OnePassword.sqlite" - this means you should compress-then-rename and not the other way around; otherwise you'll be able to successfully add the backups in the UI, however you'll receive warnings in your ~/Library/Logs/1Password/com.agilebits.onepassword4.log:

    Thu Jul 14 10:03:24 2016| 631006 [APP_PREFS:(Main Thread):
    <OPPreferencesBackupViewController: 0x7fb4e5385b60>] 
    E restore: | Error restoring backup from 
    /Users/<yourname>/Library/Application Support/1Password 4/Backups/1Password 2016-07-14 10_01_01 (1 profiles, 1 items, 0 folders, 0 attachments).1p4_zip: 
    Error Domain=com.agilebits.onepassword.ErrorDomain Code=1209 
    "Failed to restore backup as it was missing the OnePassword.sqlite file."
    UserInfo={NSLocalizedDescription=Failed to restore backup as it was missing the OnePassword.sqlite file.}
    

    2: I ended up File > Exporting the old vault, Restoring from the backup you had me create at the outset, creating a New Vault, and finally File > Importing the new 1pif file into the new vault I'd created (an alternative to sync step above) - worked well!

    Thanks so much for you help- wouldn't have figured this out without it!

  • Drew_AG
    Drew_AG
    1Password Alumni
    Options

    That's great news @mmznrksh, thank you for following up to let us know it worked! Thanks also for your additional notes - I'm sure those will be helpful for others who might be in a similar situation!

    1: the contents of the 1p4_zip file must still contain the backup sqlite file correctly named: "OnePassword.sqlite" - this means you should compress-then-rename and not the other way around

    Ah, I didn't realize you had renamed the OnePassword.sqlite file before zipping it, otherwise I would have mentioned something about that in my steps. Glad the log warnings helped you to figure that out!

    2: I ended up File > Exporting the old vault, Restoring from the backup you had me create at the outset, creating a New Vault, and finally File > Importing the new 1pif file into the new vault I'd created

    Yes, that's the other method I had in mind. Either method is fine - I gave steps to sync the vault to an OPVault file as I thought that would be a little easier. Also, an OPVault file is encrypted, whereas an exported .1pif file is not (so just make sure you delete the .1pif file once you're done with it).

    Hopefully you're all set now, but if you have more questions or need anything else, just let us know. :)

This discussion has been closed.