SQL Server – How to Restore Replicated Database

sql server

I have setup a transactional replication on a sql 2008 database.
Then I backup the database.I got following error when I try to restore the database.
'Exclusive access could not be obtained because the database is in use'

Do I have to remove the replication before restore database?

Best Answer

If it's a full backup, and there's no real-time application being in use in the database. I would suggest stopping and deleting the database for a complete clean up. After that the restore can be done and the replication could be setup automatically from the restore.