# Dreamfactory system DB in sql server

**URL:** <https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620>\
**Category:** Authentication & Security\
**Created:** [May 4, 2016, 3:39pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620 "2016-05-04T15:39:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Duncan\_Davis](https://avatars.discourse-cdn.com/v4/letter/d/f07891/32.png) [@Duncan\_Davis](https://community.dreamfactory.com/u/Duncan_Davis)\
**Post date:** [May 4, 2016, 3:39pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/1 "2016-05-04T15:39:22Z")

</div>

Is it yet possible to move the system db to sql server instead of mysql or sqllite ?

---

<div class="post-metadata">

**Author:** ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)\
**Post date:** [May 4, 2016, 4:01pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/2 "2016-05-04T16:01:32Z")

</div>

Yes. Supported system databases are SQLite, MySQL, PostgreSQL, and MS SQL Server

You can use the switch system database instructions on the wiki to change from one to another: [https://wiki.dreamfactory.com/DreamFactory/Installation#Switch\_System\_Database](https://wiki.dreamfactory.com/DreamFactory/Installation#Switch_System_Database)  
(note, this does not migrate your data, but simply sets up a clean install on the new database.)

If you encounter any issues with SQL Server, let us know. I know of one bug that has to do with Files manager in the Admin UI, but it is resolved in the next release.

---

<div class="post-metadata">

**Author:** ![Duncan\_Davis](https://avatars.discourse-cdn.com/v4/letter/d/f07891/32.png) [@Duncan\_Davis](https://community.dreamfactory.com/u/Duncan_Davis)\
**Post date:** [May 4, 2016, 4:17pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/3 "2016-05-04T16:17:00Z")

</div>

That is great news, so i have setup everything according to the documentation, when i run the php commands on artisan the last part mentions “//Answer the on screen prompts” I am not getting that or any errors when i run php artisan dreamfactory:setup is this old documentation or should i get a prompt ?

Nvm I am having some issue with the user. Thank you for the response.

---

<div class="post-metadata">

**Author:** ![m\_menon](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@m\_menon](https://community.dreamfactory.com/u/m_menon)\
**Post date:** [May 4, 2016, 5:00pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/4 "2016-05-04T17:00:11Z")

</div>

Wow just stumbled on this question. You mentioned that `this does not migrate your data, but simply sets up a clean install on the new database`. That brings up a question - If I have a fully set up DF instance with roles, permissions, scripts etc, I thought if I point another DF instance to the fully setup DF instance MySQL database, the 2nd instance should see exactly the same things that the first instance sees? 🙄

---

<div class="post-metadata">

**Author:** ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)\
**Post date:** [May 4, 2016, 6:07pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/5 "2016-05-04T18:07:33Z")

</div>

Yes. If the destination database already contains all the DreamFactory information, then it will simply connect the instance to this data. And in fact you shouldn’t even need to run the `php artisan dreamfactory:setup` command if you are attaching an instance to a database with existing DreamFactory system data. Just run the commands to clear the config and cache and restart the web server service.

---

<div class="post-metadata">

**Author:** ![m\_menon](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@m\_menon](https://community.dreamfactory.com/u/m_menon)\
**Post date:** [May 4, 2016, 6:15pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/6 "2016-05-04T18:15:13Z")

</div>

That’s cool. Thanks 👍

---

<div class="post-metadata">

**Author:** ![Duncan\_Davis](https://avatars.discourse-cdn.com/v4/letter/d/f07891/32.png) [@Duncan\_Davis](https://community.dreamfactory.com/u/Duncan_Davis)\
**Post date:** [May 5, 2016, 8:07pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/7 "2016-05-05T20:07:19Z")

</div>

When i try to bring the system db up in a nonsqlexpress sql instance i am getting actively refused from the sql server. I have already checked all security/firewall etc settings. Any ideas ?

---

<div class="post-metadata">

**Author:** ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)\
**Post date:** [May 6, 2016, 2:06pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/8 "2016-05-06T14:06:43Z")

</div>

So apart from the firewall, is SQL listening on tcp/1433? Most MS SQL installs do not have this enabled by default, which makes it so you can only connect locally.

---

<div class="post-metadata">

**Author:** ![Duncan\_Davis](https://avatars.discourse-cdn.com/v4/letter/d/f07891/32.png) [@Duncan\_Davis](https://community.dreamfactory.com/u/Duncan_Davis)\
**Post date:** [May 6, 2016, 2:21pm UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/9 "2016-05-06T14:21:11Z")

</div>

Nevermind, the ip bindings for sql server didnt have the port in them after being enabled.

---

<div class="post-metadata">

**Author:** ![tomko](https://avatars.discourse-cdn.com/v4/letter/t/eada6e/32.png) [@tomko](https://community.dreamfactory.com/u/tomko)\
**Post date:** [February 7, 2017, 9:46am UTC](https://community.dreamfactory.com/t/dreamfactory-system-db-in-sql-server/2620/10 "2017-02-07T09:46:59Z")

</div>

I was not successfull with sqlite so I cleared everything and run the setup configuring sql server.

I feel the setup did not complete succesfully as I got this:

```
Running Migrations...
Migration table created successfully.
Migration driver used: sqlsrv
Migration driver used: sqlsrv
Migration driver used: sqlsrv
SQLSTATE[42000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Introduci
ng FOREIGN KEY constraint 'db_virtual_relationship_ref_service_id_foreign' on ta
ble 'db_virtual_relationship' may cause cycles or multiple cascade paths. Specif
y ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constr
aints. (SQL: alter table "db_virtual_relationship" add constraint "db_virtual_re
lationship_ref_service_id_foreign" foreign key ("ref_service_id") references "se
rvice" ("id") on delete cascade)

```

When I hit the /setup page I get to enter the admin info but then get an error. Logs states:  
`local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getResource() on null in C:\...\vendor\dreamfactory\df-core\src\Models\BaseModel.php:761 ...`

What can I try next?
