
How to copy data sources to an IntelliJ platform IDE
Hello! This tutorial will cover some popular scenarios.
- Copying a data source within one project.
- A common data source for different projects within the same IDE.
- Copying a data source to another IDE, to another computer, to another galaxy.
Everything is simple here: there is a Duplicate item in the context menu . Keyboard shortcut: Ctrl / Cmd + D.

The password will have to be re-entered.
The data source can be made global; such a data source is “visible” from any project that you work with in this IDE. Global data sources are not visible from another version of the same IDE.

Of course, the data source can be made back local.

If the data source is global, you can transfer it by exporting settings . But I don’t always want to transfer all the settings, and the data sources are global not always :)
So it’s useful to know that the data source can be copied: in the context menu, select Database tools → Copy data source to clipboard . This will work with several at once.

The following XML gets to the clipboard:

Now click + on the toolbar and select Import from clipboard . From the XML in the clipboard, you get the same data source, but without a password. XML from the clipboard can be sent to colleagues in instant messengers or by mail.

Passwords are stored in KeePass if you are on Windows and in native repositories on Linux and MacOS. You can enable KeePass for any operating system in Settings / Preferences → Appearance and behavior → System settings → Passwords .

If for some reason the described does not solve your problems, let's go deeper.
As with our other IDEs, in DataGrip you work in the context of a project. A project is not the most obvious entity when working with SQL, so by default in DataGrip you work in the default project and probably don’t know anything about projects if you didn’t create them intentionally.
This is where this project lies:
Windows Linux ~ is an alias for the home directory, for example, / home / john. MacOS
In IntelliJ IDEA, PyCharm, and other IDEs, local data sources are also attached to the project. Information about them is stored in a file.
Do what you want: copy the entire file, make changes directly to it or put it under VCS.
If the data source is global, it will not be in this file. Look for XML with global data sources in the options folder at the same level as the projects folder.
Hope it was helpful!
DataGrip Team
- Copying a data source within one project.
- A common data source for different projects within the same IDE.
- Copying a data source to another IDE, to another computer, to another galaxy.
Copying a data source within one project
Everything is simple here: there is a Duplicate item in the context menu . Keyboard shortcut: Ctrl / Cmd + D.

The password will have to be re-entered.
Shared data source for different projects within the same IDE
The data source can be made global; such a data source is “visible” from any project that you work with in this IDE. Global data sources are not visible from another version of the same IDE.

Of course, the data source can be made back local.

Copy a data source to another IDE, to another computer.
If the data source is global, you can transfer it by exporting settings . But I don’t always want to transfer all the settings, and the data sources are global not always :)
So it’s useful to know that the data source can be copied: in the context menu, select Database tools → Copy data source to clipboard . This will work with several at once.

The following XML gets to the clipboard:

Now click + on the toolbar and select Import from clipboard . From the XML in the clipboard, you get the same data source, but without a password. XML from the clipboard can be sent to colleagues in instant messengers or by mail.

Passwords are stored in KeePass if you are on Windows and in native repositories on Linux and MacOS. You can enable KeePass for any operating system in Settings / Preferences → Appearance and behavior → System settings → Passwords .

If for some reason the described does not solve your problems, let's go deeper.
As with our other IDEs, in DataGrip you work in the context of a project. A project is not the most obvious entity when working with SQL, so by default in DataGrip you work in the default project and probably don’t know anything about projects if you didn’t create them intentionally.
This is where this project lies:
Windows Linux ~ is an alias for the home directory, for example, / home / john. MacOS
\Users\\.\config\projects\default
~/.config/projects/default
~/Library/Preferences/projects
In IntelliJ IDEA, PyCharm, and other IDEs, local data sources are also attached to the project. Information about them is stored in a file.
\.idea\dataSources.xml
Do what you want: copy the entire file, make changes directly to it or put it under VCS.
If the data source is global, it will not be in this file. Look for XML with global data sources in the options folder at the same level as the projects folder.
Hope it was helpful!
DataGrip Team