# SQL Server Restore Database task "Could not restore backup: Timeout expired"

**URL:** https://www.finalbuilder.com/forums/t/sql-server-restore-database-task-could-not-restore-backup-timeout-expired/3395
**Category:** Bugs
**Created:** [September 8, 2011, 3:17am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-task-could-not-restore-backup-timeout-expired/3395 "2011-09-08T03:17:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![markeverest](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@markeverest](https://www.finalbuilder.com/forums/u/markeverest)
#### Post date: [September 8, 2011, 3:17am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-task-could-not-restore-backup-timeout-expired/3395/1 "2011-09-08T03:17:54Z")

</div>

I have a restore database task.&nbsp;It is a large database &nbsp;- FB says "timeout expired" after 30 mins although SQL Sevrer is still restoring the database.

&nbsp;

The log (from FB server) says:

&nbsp;

| SQL Server Restore Database | SQL Server Restore Database | 13:11:21 | 13:41:22 | 00:30:01 | 
Error
 |

&nbsp;

```
Executing SQL ScriptsEnable Single-User ModeALTER DATABASE sys01 SET SINGLE_USER WITH ROLLBACK IMMEDIATERestoreRESTORE DATABASE sys01 FROM DISK='\\r200\sqlbkup\EN-ERP-DB01\ERPP1\BACKUPS\sys01\Day08-Thu-sys01.bak' WITH REPLACE, MOVE 'sys01' TO 'D:\mssql2005\ERPD1\DATA\sys01.mdf', MOVE 'sys01_log' TO 'D:\mssql2005\ERPD1\DATA\sys01_log.ldf'Could not restore backup: Timeout expiredRestore Multi-User ModeALTER DATABASE sys01 SET MULTI_USERCould not restore backup: ALTER DATABASE is not permitted while a database is in the Restoring state
```

&nbsp;

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [September 9, 2011, 3:54am UTC](https://www.finalbuilder.com/forums/t/sql-server-restore-database-task-could-not-restore-backup-timeout-expired/3395/2 "2011-09-09T03:54:54Z")

</div>

Hi Mark   
  
 I just had a quick look at the code, the timeout is hard coded at 30 minutes, I guess the developer who wrote the code (in 2007) didn’t expect a database restore to take that long. I’ll look at making that timeout configurable on Monday.
