Possible to let a new Orchard installation point to an existing Orchard SQL database?

Topics: Installing Orchard
Aug 7, 2015 at 11:04 AM
Edited Aug 7, 2015 at 11:06 AM
When I point a fresh Orchard installation to an existing SQL database of a previous Orchard installation (but of the same Orchard version), I get a message

"Setup failed: A previous Orchard installation was detected in this database with this table prefix."

which makes perfectly sense for me.

Can I explicitly let a new Orchard installation point to and use an exsting SQL database?

Background: I wonder how I would restore an existing database to a new Orchard installation? Are there any best practices?
Aug 7, 2015 at 11:37 AM
You can, simply update your Settings.txt file and update the following fields:
State: Running
DataProvider: SqlServer
DataConnectionString: (your connection string)
Marked as answer by mcmcod120 on 8/9/2015 at 5:28 AM
Aug 7, 2015 at 3:26 PM
Thank you, that works!

As additional information, I'd like to mention that it is necessary to restart the web application for the change to take effekt.
Aug 8, 2015 at 11:25 AM

Yes, either that, or just delete the hrestart.txt file in the root of the App_Data folder. This will not cause the IIS application pool to recycle, but will reset the Orchard shells.
Feb 23, 2016 at 1:18 PM
Edited Feb 23, 2016 at 1:18 PM

In addition to query, is there any possibility of connecting app with existing database if App_Data folder has been deleted??
Feb 24, 2016 at 2:27 PM
Yes, the easiest way is to copy in an existing Settings.txt file and make the modifications. If you don;t have one handy, simply setup a new default instance of Orchard, which will generate a Settings.txt file.