Author |
Topic |
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-20 : 09:51:37
|
Hello all, i am not very good with SQL but am trying, i have a database that was on a godaddy shared hosting server, i have downloaded the .bak file to try to restore to a server that i have built, when i run the restore filelistonly command i can see the mdf and the ldf files, but they are showing as being on the "d" drive, which i can only assume is where they were on the godaddy server, how do i get the files to restore to my server? here is an output when i run the follwoing sql query:restore database adu1013805164646from disk = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.BAK'with move 'adu1013805164646' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\adu1013805164646.MDF',move 'adu1013805164646_log' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\adu1013805164646_Log.LDF'and here is the error message:Msg 9953, Level 16, State 1, Line 1The path 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\adu1013805164646' has invalid attributes. It needs to be a directory. It must not be hidden, read-only, or on a removable drive.Msg 3156, Level 16, State 50, Line 1File 'sysft_adu1013805164646' cannot be restored to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\adu1013805164646'. Use WITH MOVE to identify a valid location for the file.Msg 3119, Level 16, State 1, Line 1Problems were identified while planning for the RESTORE statement. Previous messages provide details.Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.please helpthank you in advance |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-07-20 : 10:25:07
|
Do it in SSMS-Dialog, don't execute it but click on create script and the see the differences to your statement. No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2010-07-20 : 10:45:34
|
Looks like you have a full-text catalog in the backup.Try adding this to your RESTORE statement:MOVE 'sysft_adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData'You may have to create the FTData folder, if it doesn't exist. |
|
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-20 : 10:46:08
|
thank you for the quick response, not to sound dumb, but how would i do that? when i parse the query i get an error stating:Msg 102, Level 15, State 1, Line 3Incorrect syntax near 'adu1013805164646'.my statement looks fine, i copied i from someone on this forum, all i did was change the db name and file locations.also how can i change the logical name and physical names so that its not reading the files on the drive godaddy had them on?thank you again for your help, it is much appreciated |
|
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-20 : 10:50:20
|
Thanks again for the quick responses, here is my new statement with the added line:RESTORE DATABASE adu1013805164646FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.BAK',MOVE 'adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.MDF',MOVE 'adu1013805164646_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646_log.LDF',MOVE 'sysft_adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData';but i am still getting the invalid syntax near adu1013805164646 error messagethank you again for the help |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-07-20 : 11:32:21
|
I don't know to whom you have answered...Have you tried my suggestion? No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-20 : 11:42:27
|
quote: Originally posted by webfred I don't know to whom you have answered...Have you tried my suggestion? No, you're never too old to Yak'n'Roll if you're too young to die.
hi, i kind of replied to both, but i am not sure how to do what you suggestedthanks again for the help |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-20 : 22:23:58
|
no joy, i am still getting the error message about the invalid syntaxdid you take a look at my sql statement? does it look like i have it written correctly?thank you again for all help |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2010-07-21 : 01:06:09
|
There should be no comma after the FROM DISK path:RESTORE DATABASE adu1013805164646FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.BAK'MOVE 'adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.MDF',MOVE 'adu1013805164646_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646_log.LDF',MOVE 'sysft_adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData';Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
|
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-21 : 01:17:22
|
thank you for the response, but now i get this error when parsing the statement:Msg 102, Level 15, State 1, Line 3Incorrect syntax near 'MOVE'. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-07-21 : 01:30:16
|
Damn!Will it work if you do the restore in SSMS without scripting? No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2010-07-21 : 01:37:19
|
Sorry you also need to remove the extra MOVEs:RESTORE DATABASE adu1013805164646FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.BAK'MOVE 'adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.MDF','adu1013805164646_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646_log.LDF','sysft_adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData';Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
|
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-21 : 08:55:22
|
Same error message when parsing the queryMsg 102, Level 15, State 1, Line 3Incorrect syntax near 'MOVE'. |
|
|
dzylildvl
Starting Member
12 Posts |
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-21 : 09:00:16
|
this backup was generated from the go daddy hosting control panel under databases, is there another way to generate a backup from the go daddy hosting control panel? i am positive that is why i am having so many problemsthank you again for all help |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2010-07-21 : 09:32:58
|
The statement from tkizer was only missing the WITH (from reading the error message, should be WITH MOVE instead of MOVE).Try this:RESTORE DATABASE adu1013805164646FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.BAK'WITH MOVE 'adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.MDF','adu1013805164646_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646_log.LDF','sysft_adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData';Does this work? If not, post the error message. |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-07-21 : 09:39:56
|
If you are still stuck there is a guide to creating a restore command here:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54300 |
|
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-21 : 10:01:19
|
quote: Originally posted by YellowBug The statement from tkizer was only missing the WITH (from reading the error message, should be WITH MOVE instead of MOVE).Try this:RESTORE DATABASE adu1013805164646FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.BAK'WITH MOVE 'adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.MDF','adu1013805164646_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646_log.LDF','sysft_adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData';Does this work? If not, post the error message.
here is the error message:Msg 102, Level 15, State 1, Line 4Incorrect syntax near 'adu1013805164646_log'.and i would just like to thank everyone for their help |
|
|
dzylildvl
Starting Member
12 Posts |
Posted - 2010-07-21 : 10:09:27
|
quote: Originally posted by Kristen If you are still stuck there is a guide to creating a restore command here:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54300
i will give this a try this afternoon when i have a few moments to work on it, i am going to call go daddy and see if they can get me a better backup as well.thank you for your help |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-07-21 : 13:04:46
|
Well ... substituting what you have above into what is in that link I get:RESTORE DATABASE adu1013805164646 FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.BAK' WITH REPLACE, -- Overwrite DB - if one exists NORECOVERY, -- Use if DIFFs / T/Logs to recover STATS = 10, -- Show progress (every 10%) MOVE 'adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646.MDF', MOVE 'adu1013805164646_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adu1013805164646_log.LDF', MOVE 'sysft_adu1013805164646' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData' looks like you need the extra "MOVE" command keywordsNote that the Backup is in program files, as are the database files that will be created. This may not be what you want?!I don't know if that last MOVE is a file or folder (or which it needs to be ...) |
|
|
Next Page
|