Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Copy database to web server

Author  Topic 

paul83
Starting Member

4 Posts

Posted - 2006-12-12 : 09:30:18
Hi,

I'm new to SQL Server (I've worked with MS Access for several years but am now ready to step up to the next level).

I'm working with SQL Server 2000 - I have a copy of Developers Edition on my XP Pro computer at home and work mostly with shared web hosting accounts that have SQL Server 2000 available on them.

I recently received a database backup file from a client, which I was able to restore using the Query Analyzer and RESTORE. I now have to 'move/export/upload' this database to a shared web hosting account - I've created a 'blank' database on the web server (same name as restored database) and have a username and password.

This is where I'm stuck - how do I get this restored database on my local machine to a web server? Do I do this via the Query Analyzer or some other type of wizard? (I'm not even sure how to 'connect' to the web server database.)

I'm sure I'm not providing enough background, but any guidance would be greatly appreciated.

Many thanks,
Paul

Kristen
Test

22859 Posts

Posted - 2006-12-12 : 10:03:42
It would help if you have FTP access to the hosting service, and can upload your database backups, and then restore it.

If not you will have to generate a Script of the database, run that on your "blank" database, and then use DTS to transfer the data.

Kristen
Go to Top of Page

paul83
Starting Member

4 Posts

Posted - 2006-12-12 : 10:33:39
Thanks for the response.

While I do have FTP capability there are no online utilities provided by the host to restore the database on the web server (i.e., no Enterprise Manager), which forces me into a scripting solution.

So my script has to...
1) Connect to web server db
2) Copy all existing tables (structure and data) and stored procedures from local to web
3) Disconnect

Is this correct? If so, what are the basic commands I should use to do this?
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-12-12 : 11:11:50
Ask your web host for the connection parameters via EM, and you can connect remotely

1. Register your server
2. restore your data
Go to Top of Page

paul83
Starting Member

4 Posts

Posted - 2006-12-12 : 12:27:36
Thanks for the response, afrika.

I succeeded in registering the server, but am struggling with the restore. Should I use Tools > Restore Database... from EM or write something in Query Analyzer? Restore Database... in EM seems to make sense but I don't see anyway to select the backup file from my local PC.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-12-12 : 13:32:14
Yes, tools >> restore DB
or right click the database and choose all tasks >> restore db

You need to set the options as you did locally
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-12-12 : 14:05:35
Is it possible to restore from a UNC? If so the following may help:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example,Restore

Kristen
Go to Top of Page

paul83
Starting Member

4 Posts

Posted - 2006-12-12 : 14:29:30
The Restore Database feature isn't working for me - I'm simply not able to enter or select the backup file. If I choose the 'From device' option I'm unable to access my local file system (permission error). Is there a way to copy from my local SQL server to the web server SQL server or can I just drag and drop different objects from the Console window in EM?
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-12-12 : 17:32:27
Ask your webhost if you have appropriate permissions ?
Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2006-12-13 : 13:56:22
Paul,

Can you ftp the file up to the web server, and then select the backup file from there?

Ken
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-12-13 : 15:53:54
quote:
Originally posted by KenW

Paul,

Can you ftp the file up to the web server, and then select the backup file from there?

Ken



I wonder if this will work on a shared webserver, or if the db is on a remote server.

Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2006-12-14 : 13:59:51
quote:
Originally posted by afrika


I wonder if this will work on a shared webserver, or if the db is on a remote server.



Paul had indicated earlier that he could connect with EM, but couldn't select the database on his local machine. I thought perhaps if the DB was physically available on the web server, he might have better luck.

Ken
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-12-14 : 18:41:07
My point is thus:

On a remote server, the database would not be on the same physical machine running the shared website farm. So the UNC path will be wrong.

I believe there must be something he is not doing to restore the databse correctly, alternatively: he could run his db script and then use DTS to copy his data.

I have done this multiple times before, esp during migration to our new dedicated server

Afrika

Go to Top of Page
   

- Advertisement -