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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 stored procedures

Author  Topic 

warbirdcolors
Starting Member

5 Posts

Posted - 2011-01-19 : 20:57:00
I'm moving a web-site & database to a new webserver/hosting company. I backed up the database and then restored the SQL database to the new web server, but all of my stored procedures are gone?? How can I restore them? Did I save the database incorrectly? How do I bring across the stored procedures without having to re-key them all???

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-19 : 23:05:05
I seriously doubt you used backup/restore method. You likely used the database copy wizard.

With backup/restore method, you can get an EXACT copy of the source database.

Please describe the procedure you used in detail so that we can point out where you went wrong.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

warbirdcolors
Starting Member

5 Posts

Posted - 2011-01-20 : 00:32:25
To my knowledge, this is what i did:

I did a save of the database, and then moved the .bak file to my hard drive. I uploaded that .bak file to the new server, and did a restore...to a differently named database. this is going from a newer database, to an older database
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-01-20 : 01:05:05
where did you "saved" your stored procedure ? Any chance you did it in the master database ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-20 : 12:43:22
If you used backup/restore, then your databases are identical.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2011-01-20 : 16:25:08
quote:
Originally posted by warbirdcolors

To my knowledge, this is what i did:

I did a save of the database, and then moved the .bak file to my hard drive. I uploaded that .bak file to the new server, and did a restore...to a differently named database. this is going from a newer database, to an older database



Can you clarify what you mean by this? You cannot restore a database that was backed up on a new version to an older version. For example, if the system you are running is 2008 - you cannot restore that backup to a 2005 system.

Are you sure you copied a current version of the backup file and restored from the same backup file?

Jeff
Go to Top of Page

warbirdcolors
Starting Member

5 Posts

Posted - 2011-01-20 : 19:35:21
When i right-click the server(s) in SQL Server Management Studio, and select properties this is what i see:

The "from" database is version 10.0.4000.0
The "to" database is version 9.00.4309.0

I can see my tables and my data in the "new" database
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-20 : 19:36:26
You can't use backup/restore to go from 10 to 9. It's not possible, so there's no way you used backup/restore.


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

warbirdcolors
Starting Member

5 Posts

Posted - 2011-01-20 : 19:41:39
Tara,
First of all..Thanks for your help

I used the backup function within the management studio, FTP'd the .bak file to the new hosting server at godaddy.com and used their "restore" button and pointed to the .bak file

Is there a way i can "start over" to do this a different way? I know you don't see the godaddy stuff so...could it have "copied" the database from the .bak file?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-20 : 19:44:02
I haven't a clue what their restore button does, but it wasn't the RESTORE DATABASE command (assuming you have given us correct version numbers for "to" and "from").

To fix your problem, you will need to script out your missing objects on the "from" server and run the script on the "to" server. Management Studio includes a scripting wizard.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

warbirdcolors
Starting Member

5 Posts

Posted - 2011-01-20 : 19:54:55
OK, so i script each one to it's own file? and on the other end I choose New stored procedure & copy/paste?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-20 : 20:00:18
No, create one file. The scripter can put all objects in the same file.

No, just open your file in a new query window and hit F5.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2011-01-21 : 15:10:37
Instead of trying to back port everything you have developed and worked on in SQL Server 2008, why don't you have godaddy.com provide you with a 2008 instance (10.0.4000) instead of SQL Server 2005 (9.00.4309.0)?

Then, you can just do a backup/restore to get everything updated.

Besides, if you do your development work on 2008 - you have to be very careful not to use any of the 2008 specific features and data types or they will not work.

Jeff
Go to Top of Page
   

- Advertisement -