[BULK] E10 Backup and Restore

I ran into that situation once and the answer was simply bounce the SQL server and then the backup worked with no problem on 905.702A.

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 18, 2015 7:38 AM
To: vantage@yahoogroups.com
Subject: [BULK] [Vantage] E10 Backup and Restore

 

 

We are working on a re-implementation in Epicor 10.  I am trying to do a backup and restore to copy the Pilot database to the Test database.  The backup runs fine but when I try to restore I get an error that says "exclusive access could not be obtained because the database is in use".  I have stopped the application pools and tried taking it offline.  One time I tried checking the box to close existing connections, and now it is in "single user mode".  What am I missing?

We are working on a re-implementation in Epicor 10.  I am trying to do a backup and restore to copy the Pilot database to the Test database.  The backup runs fine but when I try to restore I get an error that says "exclusive access could not be obtained because the database is in use".  I have stopped the application pools and tried taking it offline.  One time I tried checking the box to close existing connections, and now it is in "single user mode".  What am I missing?

I have struggled with this from day one.  Never seems to be really consistent as far as what works but the things that works most of the time are:

1.       Stop the App pool for Test

2.       Detach and re-attach the Test DB  (as suggested to me in a reply here to a very similar question I posted)

3.       Check the DB monitor (little monitor icon at top of Window in SQL Mgmt Studio and then drop down the DB list to look for Test – if not there then no connections so good

 

In the restore itself I find it sometimes takes a long time to populate the Files info for changing the destination Db to be Test.  Sometimes I need to kill the restore and start over several times.  That is the really inconsistent part.  Eventually I can change the destination .mdb file (and lock file) to Test.

 

Lately I am restoring Pilot to Test every 2-3 days.  We also have a Test backup that has a lot of transactions that I can restore to Test (because Pilot has no transactions) and test reports and dashboards that have been added or changed.  Mostly though we are restoring Pilot to Test as Pilot gets closer to live configuration.

 

Next step,  for me…. Automating and scheduling backups.  I’ve done it before in SQL Server but it has been a couple years.  We are getting to the point where Pilot really needs to be backed up regularly.

 

-Todd C.

 

 

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 18, 2015 9:38 AM
To: vantage@yahoogroups.com
Subject: [Vantage] E10 Backup and Restore

 

 

We are working on a re-implementation in Epicor 10.  I am trying to do a backup and restore to copy the Pilot database to the Test database.  The backup runs fine but when I try to restore I get an error that says "exclusive access could not be obtained because the database is in use".  I have stopped the application pools and tried taking it offline.  One time I tried checking the box to close existing connections, and now it is in "single user mode".  What am I missing?

You need to kill any open db connections that is preventing the restore, so do the following:

use master
go
select * from master.sys.sysprocesses
where spid > 50
and dbid=DB_ID ('YourDBName')  -- replace with your database name

-- once you identified the spid to KILL, you can simply execute:

KILL xx -- replace with the spid (xx) with the one returned

-- now restore

Alternately, I have seen people create a new DB and then change the DB that the Application Server is pointing to in theApplication Server DConfiguration in Admin Console.

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 18, 2015 11:28 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: E10 Backup and Restore

 



You need to kill any open db connections that is preventing the restore, so do the following:

 

use master

go

select * from master.sys.sysprocesses

where spid > 50

and dbid=DB_ID ('YourDBName')  -- replace with your database name

 

-- once you identified the spid to KILL, you can simply execute:

 

KILL xx -- replace with the spid (xx) with the one returned

 

-- now restore

 




I have tried both suggestions and still am getting nowhere.  I used the command line suggestion and didn't see any connections.  I ran the same thing for the Pilot database and could see the live connections.


I also tried stopping the app pool, detaching and reattaching but I don't see the db monitor button.  When I detached I checked the box to drop connections (It shows there are 2 connections) but still get the same message.


This really shouldn't be this difficult.


I created a new database and still get the error when trying to restore to it.  I haven't made any connection to the Epicor software so I don't know what could possibly have it open.


The other thing I found when I created the new database is that all my existing databases are in the MSSQL\Backup folder.  The new database I created is in the MYSQL\Data folder along with the reports databases.  Is this correct?  I had it installed by Epicor.

run the sp_who and sp_who2 procedures to see who / what is using the DB. This will also give you the PID of the process using it, you may be able to kill it (though not recommended)


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Wed, Feb 18, 2015 at 2:00 PM, mtellefson@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p>I created a new database and still get the error when trying to restore to it.  I haven&#39;t made any connection to the Epicor software so I don&#39;t know what could possibly have it open.</p><p><br></p><p>The other thing I found when I created the new database is that all my existing databases are in the MSSQL&#92;Backup folder.  The new database I created is in the MYSQL&#92;Data folder along with the reports databases.  Is this correct?  I had it installed by Epicor.<br></p><p></p>

</div><span class="ygrps-yiv-1900011943">
 


<div style="color:#fff;min-height:0;"></div>


You may be aware of this already, but I didn't see it specifically mentioned.  Where are the files you are restoring pointed at?  If you are taking Pilot to Test, the files will still be pointed at the Pilot files.  You need to change them to Test or something else other than Pilot.  This is not the same as selecting the DB you are restoring to.  Select Files, Restore As, change the file names. (Step 12 below)


This is what works for me.  I am new to this as well.  I am doing the exact same thing - re-implementing V8.03 on ERP10.  If anyone has any suggestions to improve this process, I appreciate all comments.  Thanks


1. Right click on the database you wish to restore, and select Tasks-->Restore-->From Database.
2. Select the "From Device:" radio button.
3. Select ... and choose the backup file of the other database you wish to restore from.
4. Select from dropdown under Destination which Database you are restoring to.
5. Select the backup set you wish to restore from by selecting the check box to the left of the backup set.
6. Change destination database to Database you are restoring to.
7. Select "Options".
8. Select Overwrite the existing database (WITH REPLACE)
9. Uncheck take tail-log as necessary for what you are doing [sometimes grayed-out but still works]
10. Check Close exisitng connections to destination database [If this is grayed out, you might try to stop the application pools on the Epicor Server for that database.]
11. Select "Files"
12. Change the "Restore As" Rows Data file name to the file name of the existing database you wish to overwrite or just give it a new name
13. Click OK.
14. If stopped in step 10, start Application Pools.
15. Recycle IIS Application Pools
16. Restart Task Agent for this Database [This can be done from Epicor Admin Console if stuck, Open Windows Services and restart Epicor ICE Task Agent]


Doug Oswald

Fleetwood

Got it!!!  Thanks Doug.  I only added step 12.5 and changed the "Restore As" log file to the destination database as well.  Otherwise I got an error that it couldn't access the log file for our Pilot database.


All this help before I even got a call back from Epicor.