CopyKeepass is a lightweight Python script that helps you duplicate one KeePass database into a new .kdbx file while preserving the folder structure and entries.
It is useful when you want to create a copy of an existing KeePass database with a new file name or new master password, without manually recreating the database structure.
- Copies KeePass groups and subgroups
- Copies entries and preserves:
- title
- username
- password
- URL
- notes
- Creates a new target KeePass database from a source database
- Runs from the command line with simple prompts
- Python 3
pykeepass
Install the dependency:
pip install pykeepass- Clone the repository:
git clone https://github.com/ReloadedUser/CopyKeepass.git
cd CopyKeepass- Install the dependencies:
pip install pykeepass- Run the script:
python main.py- When prompted, provide:
- the path to the source
.kdbxfile - the path to the new
.kdbxfile to create - the source database master password
- the new database master password
- the path to the source
The script:
- Loads the source KeePass database using
PyKeePass - Creates a new database at the target path
- Copies the root group name and hierarchy from the source database
- Recreates sibling and nested groups in the target database
- Adds each entry into the appropriate target group
- Saves the new database
- Always keep backups of your KeePass files before making copies.
- Use a strong password for the newly created database.
- This script is intended for terminal use and uses interactive prompts.
python main.pyExample prompts:
Enter the path to the new .kdbx file:
/path/to/new_database.kdbx
Enter the path to the old .kdbx file:
/path/to/source_database.kdbx
Enter the password (master key) to the old .kdbx file:
********
Enter the password (master key) to the new .kdbx file:
********
Pull requests and suggestions are welcome. If you would like to improve the tool, please fork the repository and submit your changes.