I've created a new namespace on our staging environment and used it for custom metadata properties.
I've seen many articles to import the new namespaces using AEM namespace editor.
Is there a way to package the one we created on our Staging and install it on PROD. (assuming that AMS wouldn't provide access to namespace editor on PROD Environment).
okay i tried something else again.
i went into the package that i got from my local instance with new namespaces added to "\jcr_root\_jcr_system\content.xml"
when i tried installing this package to another instance, it didn't add any new namespaces.
but i found a nodetypes.cnd file in this package "\META-INF\vault\nodetypes.cnd".
i added the new namespaces in this file like this:
installed the package with new changes. and YASSSSS! my new namespaces are available on this instance.
please let me know if this is not a best practise and have to be done differently.
is there a reference article or something you could provide for this please.
i found this: Using the CRX2Oak Migration Tool
but it doesn't specify anything about namespace migration.
Please let me know if you find any.
Yes, I wasn't sure about the package. You should try with crx2oak as I mentioned in my comment earlier. Use --merge-paths=jcr:system/rep:namespaces in the crx2oak migration command.
Adding or Deleting namespaces from AEM using CRX/DE is not possible. it gets deleted. but once we save and refresh, they are back to their normal state.
i tried packaging them from my local and installed the package on our dev server. it doesn't install the new ones that i created.
You need to use crx2oak to migrate the namespaces
Namespaces are stored under /jcr:system/rep:namespaces.
I think you can create a package or migrate to target using the crx2oak tool (--include-paths=jcr:system/rep:namespaces)
ASFAIK .. there is no specifc tool for exporting the namespce. you can go to http://localhost:4502/crx/explorer/ui/namespace_editor.jsp and see all namespaces, you might wanty to use small JS script to extract those namespaces and print them into a nice CND.
once you get the CND, you can use the import node type (/crx/explorer/nodetypes/index.jsp) and paste the CND's.
this should work for you..
sample script - please test.