# How can i store multiple datasource in same liquibase.properties

**URL:** <https://forum.liquibase.org/t/how-can-i-store-multiple-datasource-in-same-liquibase-properties/6767>\
**Category:** General Discussion\
**Created:** [April 19, 2022, 11:26am UTC](https://forum.liquibase.org/t/how-can-i-store-multiple-datasource-in-same-liquibase-properties/6767 "2022-04-19T11:26:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![addy3494](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/addy3494/32/685_2.png) [@addy3494](https://forum.liquibase.org/u/addy3494)\
**Post date:** [April 19, 2022, 11:26am UTC](https://forum.liquibase.org/t/how-can-i-store-multiple-datasource-in-same-liquibase-properties/6767/1 "2022-04-19T11:26:01Z")

</div>

How can i store multiple datasource in same liquibase.properties

```auto
url=jdbc:oracle:thin:@1.2.3.4:1621/some_name.com
classpath=/path
username=user
password=pass
liquibase.hub.mode=off

```

how can add another url to the same properties file ?

---

<div class="post-metadata">

**Author:** ![MikeOlivas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/mikeolivas/32/183_2.png) [@MikeOlivas](https://forum.liquibase.org/u/MikeOlivas)\
**Post date:** [April 19, 2022, 12:53pm UTC](https://forum.liquibase.org/t/how-can-i-store-multiple-datasource-in-same-liquibase-properties/6767/2 "2022-04-19T12:53:26Z")

</div>

Hi @addy3494  
There can only be one url in the properties file.  
Another option is to create a new one for each connection that you need.  
dev.liquibase.properties  
test.liquibase.properties  
or  
conn1.liquibase.properties  
conn2.liquibase.properties  
etc.  
And then on the command line provide a `--defaultsFile=test.liquibase.properties` parameter.  
Another option is to add it as a commandline variable.  
`liquibase --url=jdbc:oracle:thin:@1.2.3.4:1621/some_name.com`  
A third option is to use Liquibase Pro and add it as an environment variable.  
`set liquibase.command.url=jdbc:oracle:thin:@1.2.3.4:1621/some_name.com`

---

<div class="post-metadata">

**Author:** ![addy3494](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/addy3494/32/685_2.png) [@addy3494](https://forum.liquibase.org/u/addy3494)\
**Post date:** [April 19, 2022, 1:39pm UTC](https://forum.liquibase.org/t/how-can-i-store-multiple-datasource-in-same-liquibase-properties/6767/3 "2022-04-19T13:39:41Z")

</div>

Can I pass —defaultsFile twice ? For each property

---

<div class="post-metadata">

**Author:** ![MikeOlivas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/mikeolivas/32/183_2.png) [@MikeOlivas](https://forum.liquibase.org/u/MikeOlivas)\
**Post date:** [April 19, 2022, 3:03pm UTC](https://forum.liquibase.org/t/how-can-i-store-multiple-datasource-in-same-liquibase-properties/6767/4 "2022-04-19T15:03:41Z")

</div>

Hi @addy3494  
Let’s take a step back and maybe give more context on what you are trying to accomplish.  
Can you describe the use case you are trying to do?

---

<div class="post-metadata">

**Author:** ![addy3494](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/addy3494/32/685_2.png) [@addy3494](https://forum.liquibase.org/u/addy3494)\
**Post date:** [August 18, 2022, 7:25pm UTC](https://forum.liquibase.org/t/how-can-i-store-multiple-datasource-in-same-liquibase-properties/6767/6 "2022-08-18T19:25:59Z")

</div>

Im ok to maintain  
conn1.liquibase.properties  
conn2.liquibase.properties

can the liquibase update be achieved in single run for 2 properties?  
For Example,

```auto
liquibase --changelog-file=dbchangelog.xml --defaultsFile=conn1.liquibase.properties --defaultsFile=conn2.liquibase.properties update

```

---

<div class="post-metadata">

**Author:** ![MikeOlivas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/mikeolivas/32/183_2.png) [@MikeOlivas](https://forum.liquibase.org/u/MikeOlivas)\
**Post date:** [August 24, 2022, 1:56pm UTC](https://forum.liquibase.org/t/how-can-i-store-multiple-datasource-in-same-liquibase-properties/6767/7 "2022-08-24T13:56:34Z")

</div>

You cannot connect to 2 different databases in one update with the Liquibase Open Source version, you would need to run

```auto
liquibase update conn1
liquibase update conn2
```
