Importing KeePass Custom Fields and Historical Passwords

Backlog

Importing KeePass Custom Fields and Historical Passwords

0 vote

avatar

I have some KeePass databases with entries that make use of custom string fields. In some cases, this was done in order to store something besides username and password, like an account number, that is required on a login screen. In other cases, this was used to store other supplemental information, such as account recovery information that had to be entered when an account was created.

After doing a little testing with Devolutions Hub Importer, it looks like those string fields aren't getting imported into the new entries in my Devolutions Hub vault. Given that Hub supports creating custom fields in entries, it seems like having the Hub Importer bring that data over would be a useful feature addition. I've checked, and the custom fields are present in the KeePass XML export as string key/value pairs.

Perhaps if there is a string key/value pair for an entry in the XML export that doesn't map into a known key, such as Notes; Password; Title; UserName; or URL, it could be assumed that the string is a custom field, which could then be automatically created in the imported entry in Hub. The ProtectInMemory attribute for the value in the KeePass XML export could be used to determine whether to store the custom field as Text or Sensitive in the new entry.

If it were possible to import historical passwords from a KeePass entry, that would be nice as well, as we will need to keep the old KeePass databases around for reference in the event that we ever need to restore from an old backup. As with the custom fields, it looks like the information is available in the KeePass XML, it would just be a matter of doing something with it.

All Comments (3)

avatar

Hello,

Thank you for the request. For the first part about the additional fields, we will open a ticket, it should definitely be possible.

For the historical passwords, are those also exported in the keepass XML file?

Regards,

Hubert Mireault

avatar

Looking through an XML export, it appears that KeePass saves all of the history for an entry by adding <History></History> tags within the main entry and then copying the previous versions of the entry inside of those. It seems to save complete records of previous entry versions each time that anything in the record is changed.

While the historical data is there in the XML, looking through to see what actually changed from version to version of the entry and only pulling in changes to passwords might be more programming work and offer less fidelity to the original data than to just parse through each history entry and import them all as sub-entries within Hub.

I could imagine the main entries getting imported as they do now, but for there to be an option, either for the entire import or per-entry when selecting which entries to import, to import the entry history along with the main entry. Each of those history records could then be added as sub-entries of the main entry in Hub, perhaps including the LastModificationTime data from the historical entry in KeePass in the name of the sub-entry in Hub in order to make it easy to find which historical record is needed. It might also make sense to assign a specific "History" icon to historical sub-entries to make them easy to differentiate from regular entries.

To illustrate this better, here is the XML markup (with the actual data removed) from an entry record with two historical versions:

<Entry>
	<UUID></UUID>
	<IconID></IconID>
	<ForegroundColor></ForegroundColor>
	<BackgroundColor></BackgroundColor>
	<OverrideURL></OverrideURL>
	<Tags></Tags>
	<Times>
		<CreationTime></CreationTime>
		<LastModificationTime></LastModificationTime>
		<LastAccessTime></LastAccessTime>
		<ExpiryTime></ExpiryTime>
		<Expires></Expires>
		<UsageCount></UsageCount>
		<LocationChanged></LocationChanged>
	</Times>
	<String>
		<Key></Key>
		<Value></Value>
	</String>
	<String>
		<Key></Key>
		<Value ProtectInMemory="True"></Value>
	</String>
	<String>
		<Key></Key>
		<Value></Value>
	</String>
	<String>
		<Key></Key>
		<Value></Value>
	</String>
	<String>
		<Key></Key>
		<Value></Value>
	</String>
	<AutoType>
		<Enabled></Enabled>
		<DataTransferObfuscation></DataTransferObfuscation>
		<Association>
			<Window></Window>
			<KeystrokeSequence></KeystrokeSequence>
		</Association>
	</AutoType>
	<History>
		<Entry>
			<UUID></UUID>
			<IconID></IconID>
			<ForegroundColor></ForegroundColor>
			<BackgroundColor></BackgroundColor>
			<OverrideURL></OverrideURL>
			<Tags></Tags>
			<Times>
				<CreationTime></CreationTime>
				<LastModificationTime></LastModificationTime>
				<LastAccessTime></LastAccessTime>
				<ExpiryTime></ExpiryTime>
				<Expires></Expires>
				<UsageCount></UsageCount>
				<LocationChanged></LocationChanged>
			</Times>
			<String>
				<Key></Key>
				<Value></Value>
			</String>
			<String>
				<Key></Key>
				<Value ProtectInMemory="True"></Value>
			</String>
			<String>
				<Key></Key>
				<Value></Value>
			</String>
			<String>
				<Key></Key>
				<Value></Value>
			</String>
			<String>
				<Key></Key>
				<Value></Value>
			</String>
			<AutoType>
				<Enabled></Enabled>
				<DataTransferObfuscation></DataTransferObfuscation>
			</AutoType>
		</Entry>
		<Entry>
			<UUID></UUID>
			<IconID></IconID>
			<ForegroundColor></ForegroundColor>
			<BackgroundColor></BackgroundColor>
			<OverrideURL></OverrideURL>
			<Tags></Tags>
			<Times>
				<CreationTime></CreationTime>
				<LastModificationTime></LastModificationTime>
				<LastAccessTime></LastAccessTime>
				<ExpiryTime></ExpiryTime>
				<Expires></Expires>
				<UsageCount></UsageCount>
				<LocationChanged></LocationChanged>
			</Times>
			<String>
				<Key></Key>
				<Value></Value>
			</String>
			<String>
				<Key></Key>
				<Value ProtectInMemory="True"></Value>
			</String>
			<String>
				<Key></Key>
				<Value></Value>
			</String>
			<String>
				<Key></Key>
				<Value></Value>
			</String>
			<String>
				<Key></Key>
				<Value></Value>
			</String>
			<AutoType>
				<Enabled></Enabled>
				<DataTransferObfuscation></DataTransferObfuscation>
			</AutoType>
		</Entry>
	</History>
</Entry>


avatar

Hello,

Thank you for the details! I think you bring up an interesting point with adding an option to add these historical entries as subentries. I have added this information to our internal ticket.

Regards,

Hubert Mireault