How to take a backup for the 'connection details' in sqldeveloper?

What is the process to take a backup of all the connection-details (viz. host,port,sid,etc.) in 'oracle sqldeveloper' software.
How can we import these connection details to some other machine ?


Solution 1:

The 'oracle sqldeveloper' stores all the connection details in an xml file ie. connections.xml.
If you want to have a backup for the connection details, you will have to navigate to

In windows XP
C:\Documents and Settings\<YourUserName>\Application Data\SQL Developer\systemX.X.X.X.X\o.jdeveloper.db.connection.X.X.X.X.X.X.X\

In Windows 7
C:\Users\<YourUserName>\AppData\Roaming\SQL Developer\systemX.X.X.X.X\o.jdeveloper.db.connection.X.X.X.X.X.X.X\

and take a backup of connections.xml .

Later, if you need to use the same connections on some other machine, you may simply copy the <Reference ...> tags for respective connections.

Solution 2:

From Sql developer you can export the connections and then easily import them

  1. Right click connection.
  2. Select Export
  3. Browse to provide it a xml file path to export connection. Select Ok.
  4. Click Import in connections similarly to export.
  5. Select the xml file and all your connections should be imported.

Note : If you are using Connection type as TNS and providing alais then you will have to export tnsnames.ora file separately. Then provide it to sql developer using

Tools -> Preferences -> Database -> Advanced -> Tnsnames directory

Solution 3:

Step 1. Right click on connections and choose the Export Connections.

enter image description here

Step 2. In the File Name sections provide the name of connections file you want to save at your local computer. and click OK. your connections xml file will be saved at your provided location.

enter image description here

NOTE: To import the connections in your sql developer choose the Import Connections..

Solution 4:

This link Migrating Oracle SQL Developer Connections with Passwords provides a much better way to do it.

Solution 5:

Do to unfortunate circumstances, a new Windows profile was set up for me so I lost all my database connections. Fortunately, my old profile folder had been saved under a different name before the new one was set up.

I was able to use the information from two of the above answers and this post to import my connections with passwords.

Steps:

When in SQL Developer, I right-clicked on "Connections" and chose "Import Connections..." as per the answer by @AniketThakur.

I selected the connections.xml file from my old profile. I found it using the answer by @Satyendra.

The Import dialog gives the choice of discarding passwords or entering the key that was used to encrypt them. This is where this post helped. I found the key by searching under the \systemX.X.X.X.X\ folder for a file named product-preferences.xml. Inside that file I searched for an element that looked like:

<value n="db.system.id" v="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>

It appears the v value is the key that is needed to decrypt the passwords.

Note: The product-preferences.xml file was under:

\systemX.X.X.X.X\o.sqldeveloper\