I do a lot of moving of databases between development and production servers. If I’m lucky, the production server I’m working with gives me access to DTS services, or even the Database publishing wizard. More often than not however, the SQLServer I’m pushing to is locked down in a way that I am required to Remote Desktop into the server, then update the database via restore.
So here’s the tip. When you’re only means of updating a remote SQLServer database is by physically restoring the database, do your best to mirror the product server’s database location on your development machine. Check out this screenshot, and you’ll see what I mean
The background of this image shows that my production server houses all of it’s databases at the path C:DBdatabase.mdf.
The lower right box shows where I keep my databases on my development server. Since I do not store any vital data on my C: drive, I’ve changed the path to D:DB.
While this isn’t an exact path match, this trick saves me a little bit of time and frustration when restoring a database remotely. Especially when I have to do it more than a handful of times in the same day.
It’s assumed you know how to the following :
- Back up a SQLServer database
- Copy the BAK file to a remote server
- Connect remotely to your SQLServer
- Restore a Database file from a file ( BAK file )
