Export/Import Run Configurations?

I have a very complicated run environment set up in PyCharm that I use to debug our product. Several other engineers want to source-level debug like I do, but manually reading out my run configuration(s) and having them type them in is both very time consuming and error prone.

Is there any way to export/import run configurations?
11
8 comments
I don't think so. But if you go to the setup dialog of the run configuration (run configurations drop down > Edit configurations), there should be a checkbox "Share" right next to the name of the run configuration. What it does is that it stores the settings of that run configuration in the .ipr file (or in the .idea directory). If you share your project file with your team through version control, they'll have access to that run configuration as well. Hope that helps!
3
Avatar
Permanently deleted user
If you enable Share checkbox in the run configuration panel it would be saved to .idea/runConfiguraions folder.
9
Cool! That works. Thanks Dirk and Dmitry.
0

This doesn't work for me.  I was running my app on a tomcat server yesterday when I got a Blue Screen of Death.  I have half a dozen run configurations set up (in a runConfigurations directory) but today when I went to restart Intellij for the first time since the BSOD it told me it couldn't read a settings file, so I opened the .iml instead. 

I'm only being offered ONE of my run configs - how can I load the others?

0
Avatar
Alexander Iljushkin

Hey Kate, I believe you can read your configurations in the .idea/runConfiguraions folder and cut out your old stuff manually into new configs. If it's empty, I'm sorry, you've lost it.

0

I had some run configurations in one project and wanted to move them to another.  Here's the manual process I used, which worked fine on the PyCharm Community Edition 2017.1.2

Close PyCharm

Find the source and target workspace.xml files (in .idea directories)

Find the <component name="RunManager"...> element in both

Copy the children elements <configuration default="true" type="PythonConfigurationType" factoryName="Python"> from the source to the target, making sure you paste them into the RunManager component.  I put mine at the end of that component, after the pre-existing configurations in the target.

Find the <list size=...> element in both

Copy the children elements <item index="0" class="java.lang.String" itemvalue=...> from the source to the target, making sure you paste them after the pre-existing ones in the target.
 
Adjust the index= numbers for the ones you just pasted in, so that the sequence is correct.  Change the 
<list size="...> to have the correct size for the combined list, noting that the index numbers are 0 relative, so the size number will be one more than the last index number.  
 
Save the target workspace.xml file, reopen PyCharm, and enjoy your manually imported run configurations.
 
Note:  I originally was copying run configurations from a lower directory to a higher one in the same repository, and the steps above were sufficient.  Later, I had reason to copy run configurations from one repository to another.  For that, there is an additional change:  each run configuration has a <module name=" element that needed to be changed as well.  In my case, it was the highest level directory of the respective repos.
2

If it will be possible to copy-paste run / debug configuration between PyCharm instances it will also useful.

0

I symlink my .run directory to another repo where I store the run configs for all my projects.  Then I can keep them backed up and synchronised across machines.

0

Please sign in to leave a comment.