Sometimes it makes sense to continue with a new design based on an existing project but keep the old one intact. Here we do not only want to clone the schematics but also pcb-layout
and all other aspects of the original design. So the new plan starts by editing/changing and adding elements to the cloned kiCad project.
- Create the new-name-directory at the same level as an old project.
- Recursively copy the old project files into the new project tree.
- Remove fabrication output contents.
- Remove, in the KiCad directory, the
fp-info-cache
file and thebackups
directory. - Use the
rpl
command to first simulate a run, with the-s
option for the text replacement, i.e., the project name. - Replace the old project name with the new project name.
- Rename a few KiCad files in the KiCad directory and the directory path up to the top folder.
- Done!
pip3 install rpl
rpl --version
Do not leave whitespace in the project name; here, use a hyphen like new-project-name
.
mkdir new-project
cp -r old-project/* new-project
Remove the fabrication
files in the gerbers
and assembly
folders, the cache
file, and the backup
directory in the KiCads home directory. Also, remove all pdf-datasheets and the tmp
-directory, which rpl does not handle.
If the rpl simulated run results in failures, see above. Errors can be perfectly normal for non text files, like images etc.
cd new-project-name
rpl -s -R old-project-name new-project-name *
rpl -R old-project-name new-project-name *
Finally, rename a few files in the KiCad directory with the prefix new-project-name
and update the directory path with the new project name. Copy the datasheets manually and delete any temporary files to save space.
Open the new project, and everything is now ready.