If I wanted to rename a schematic project


#1

If I wished to rename a project from proj1 to projx, could I JUST DO …

  • rename a files that have ‘proj1’ in their names to use ‘projx’
  • replace all instances of ‘proj1’ with ‘projx’ in all files ?

I tied that … but must have missed something as when I reopen a schematic the parts don’t show up.


#2

Please use the search feature of these forums. Search for “rename project”.
EDIT: or do you mean you have a standalone KiCad schematic file without a KiCad project?


#3

In particular see https://forum.kicad.info/t/faq-renaming-a-project/8615
This is a task that should be a lot simpler to do, something to be pushed as a wishlist item after V5 release.


#4

That particular thread is in Lounge section and isn’t available for all forum users.


#5

Not anymore :slight_smile:

(and some more characters)


#6

This wishlist report is only 9 years old :slight_smile:
https://bugs.launchpad.net/kicad/+bug/594051

Please vote!


#7

It just seems such a basic thing to want to do, especially when you are forking a design to experiment with changes or to deal with versioning


#8

As near as I can tell from that thread, it’s basically saying “just rename the files,” which is what the OP did. Just renaming the files always works for me, so I’m unclear what the OP is doing wrong.


#9

I just grepped one project and the project name is inside many files. Use some tool which can do global search/replace.

Most of them, or maybe all which matter, seem to be about the symbol library cache file:

zLight/sym-lib-table: (lib (name zLight-cache)(type Legacy)(uri ${KIPRJMOD}/zLight-cache.lib)(options “”)(descr “”))
zLight/zLight.sch:LIBS:zLight-cache
zLight/PLED1.sch:LIBS:zLight-cache

The net file must be changed or recreated. Gerbers carry the project name, too.


#10

If OP has a rescue lib then they will also need to correct everything that has to do with the rescue lib. (Similarly with the cache lib.)


#11

But the OP said:

So how is that not the same thing?

Sure, but they said:

So that would include the cache library and rescue library.

So I’m still not clear how what you’re describing is different than what the OP described.


#12

The rescue lib is referenced within the project file. so changing it’s name means you need to touch the project file. (That is what i meant with “correct everything that has to do with these libs”)
If you do not change it’s name you will create a second rescue file if you need to again rescue symbols in the future. (As kicad will then use the new project name)


#13

But, this should be handled by the search-and-replace he did within the files:

Right?


#14

Only if the regex used for the replacement is correct. (And only if the original poster knew about that.)

Any mistake and you might end up with invalid files. (Especially if the old project name by accident had parts in it that are used elsewhere in the files.)

So my guess is that a simple text replace might not always result in the expected result. You need to be smarter about it and ensure that only the things that need to be touched are changed.


#15

Sorry, I understood, maybe hastily, that it was in all file names.


#16

Explaining something like that to a beginner scares me.
This really needs to be a core feature.


#17

Have we missed one obvious solution? Leave the file names of cache and rescue libs untouched, and there’s no need to edit files. Has someone tried that, would the project still work?


#18

I touched on that already. At least for the rescue lib there will be a second one generated if new symbols need rescuing.

For the cache lib i fear, that one really needs to have the same name as the project. (Again because kicad will automatically generate one with that name if it does not find one.)


#19

Ahh, again, too quick reading.


#20

I realize that probably nothing of this discussion helped the original poster. If the problem persists, we need more information. What version of KiCad? Did you copy the project to another location and then tried renaming the new one? Or there might be something else. It would be easiest if you could share the whole project.