How to get online the database which has missing/corrupted FILESTREAM files?
I finally found how to do it. I've found some very old backups. The data changed meanwhile, and it was important to have an up-to-date version of this data, which meant that it wasn't possible to just restore the old backup. Instead, I did the following, thanks to Michael Eklöf on ServerFault:


Copy the current .mdf and .ldf files.
List the filegroups of the old backup:

use [master]
go

restore filelistonly
from disk = 'E:\Database backups\Hello_backup_2012_03_10_202359_9203520.bak'
go

Restore the database from the old backup, with the names of filegroups from the previous result:

restore database [Hello]
from disk = 'E:\Database backups\Hello_backup_2012_03_10_202359_9203520.bak'
with move 'Hello' to 'D:\Database\Hello.mdf',
move 'Hello_log' to 'D:\Database\Hello_log.ldf',
move 'Hello_files' to 'D:\Database\Hello_files'
go

Set to offline the filegroup (in my case, the FILESTREAM) which is missing in the new version of the database:

alter database [Hello]
modify file (name = 'Hello_files', offline)
go

Take the database offline.
Replace the .mdf and .ldf files created by the server at step 3 by the files copied at step 1.
Take the database online.


There are still consequences of the missing filegroup. Some operations require the database to be complete; on of those critical operations is the backup. In other words, full backup is impossible to do with a database restored through the six steps above.

In order to get the backup ability back, I've copied the structure of the database (through Tasks → Generate Scripts...) excluding the tables which relied on filestream and then copied the data itself.