Discussione:
Importare un DB da SQL 2000 a SQL 2005 Express
(troppo vecchio per rispondere)
Destro
2006-02-01 17:35:27 UTC
Permalink
Salve,
sto cercando di importare un DB di SQL Serve 2000 su un SQL 2005 Express
Ho letto che in teoria dovrebb essere semplicissimo. Ecco come procedo:
Faccio un Backup dal SQL 2000... credo un DB con lo stesso nome su SQL 2005
(su un altra macchina) ed effettuo il restore del file di backup
Qui di seguito l'errore che esce... mi da lo stesso errore con tutti i DB
che ho tentato di importare... dove sbaglio?
Grazie
Andrea

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Restore failed for Server 'MELKIOR\SQLEXPRESS'.
(Microsoft.SqlServer.Express.Smo)

For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: The backup set holds a backup of a database
other than the existing 'DlpDB' database. (Microsoft.SqlServer.Express.Smo)

For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&LinkId=20476
Marcello
2006-02-01 17:40:50 UTC
Permalink
Post by Destro
Salve,
Ciao,
Post by Destro
sto cercando di importare un DB di SQL Serve 2000 su un SQL 2005 Express
Faccio un Backup dal SQL 2000...
ok
Post by Destro
credo un DB con lo stesso nome su SQL 2005 (su un altra macchina)
?? perchè, il restore crea il db che serve.
Post by Destro
ed effettuo il restore del file di backup
ok

prova senza creazione del db.

marc.
Destro
2006-02-01 17:55:00 UTC
Permalink
Post by Marcello
Post by Destro
Salve,
Ciao,
Post by Destro
sto cercando di importare un DB di SQL Serve 2000 su un SQL 2005 Express
Faccio un Backup dal SQL 2000...
ok
Post by Destro
credo un DB con lo stesso nome su SQL 2005 (su un altra macchina)
?? perchè, il restore crea il db che serve.
Post by Destro
ed effettuo il restore del file di backup
ok
prova senza creazione del db.
marc.
ok...ho cancellato il DB e ho fatto il restore dal file e mi da quest'altro
errore:
TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Restore failed for Server 'MELKIOR\SQLEXPRESS'.
(Microsoft.SqlServer.Express.Smo)

For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: Directory lookup for the file "C:\Program
Files\Microsoft SQL Server\MSSQL\data\DlpDB_Data.MDF" failed with the
operating system error 3(The system cannot find the path specified.).
(Microsoft.SqlServer.Express.Smo)

For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&LinkId=20476
Lorenzo Benaglia
2006-02-01 20:27:19 UTC
Permalink
Post by Destro
ok...ho cancellato il DB e ho fatto il restore dal file e mi da
Ciao Destro,

i suggerimenti proposti da marcello sono esatti, è sufficiente fare un
banale full backup del database SQL Server 2000 ed eseguire il relativo
restore sull'istanza SQL Server 2005.

Guarda questo esempio:

Apro una connessione con Query Analyzer ad una istanza SQL Server 2000

/***************************/
/* Istanza SQL Server 2000 */
/***************************/

/* 1) Eseguo un full backup del database Northwind */
BACKUP DATABASE Northwind
TO DISK = 'C:\Nwind.bak';
GO

/* Output:

Processed 376 pages for database 'Northwind', file 'Northwind' on file 1.
Processed 1 pages for database 'Northwind', file 'Northwind_log' on file 1.
BACKUP DATABASE successfully processed 377 pages in 0.151 seconds (20.405
MB/sec).

*/

/* 2) Copio il file C:\Nwind.bak sul server che ospita SQL Server 2005 */

Ora mi sposto sul server di destinazione con SQL Server 2005 e da SQL Server
Management Studio Express provvedo ad effettuare il restore:

/***************************/
/* Istanza SQL Server 2005 */
/***************************/

/* 3) Effettuo il restore */
RESTORE DATABASE Northwind
FROM DISK = 'C:\Nwind.bak'
WITH
MOVE 'Northwind' TO 'C:\northwnd.mdf',
MOVE 'Northwind_log' TO 'C:\northwnd.ldf';
GO

/* Output:

Processed 376 pages for database 'Northwind', file 'Northwind' on file 1.
Processed 1 pages for database 'Northwind', file 'Northwind_log' on file 1.

*/

Come vedi nel comando RESTORE sono andato a specificare la clausola WITH
MOVE che ti permette di specificare un nuovo path dei file fisici che
costituiscono il database.
Dato che di default le due versioni di SQL Server utilizzano path differenti
per memorizzare tali files, sei costretto a specificare la clausola WITH
MOVE se non vuoi incorrere nel messaggio d'errore che hai segnalato.

Ciao!
--
Lorenzo Benaglia
Microsoft MVP - SQL Server
http://blogs.dotnethell.it/lorenzo
http://italy.mvps.org
Destro
2006-02-01 21:11:28 UTC
Permalink
Post by Lorenzo Benaglia
Post by Destro
ok...ho cancellato il DB e ho fatto il restore dal file e mi da
Ciao Destro,
i suggerimenti proposti da marcello sono esatti, è sufficiente fare un
banale full backup del database SQL Server 2000 ed eseguire il relativo
restore sull'istanza SQL Server 2005.
Apro una connessione con Query Analyzer ad una istanza SQL Server 2000
/***************************/
/* Istanza SQL Server 2000 */
/***************************/
/* 1) Eseguo un full backup del database Northwind */
BACKUP DATABASE Northwind
TO DISK = 'C:\Nwind.bak';
GO
Processed 376 pages for database 'Northwind', file 'Northwind' on file 1.
Processed 1 pages for database 'Northwind', file 'Northwind_log' on file 1.
BACKUP DATABASE successfully processed 377 pages in 0.151 seconds (20.405
MB/sec).
*/
/* 2) Copio il file C:\Nwind.bak sul server che ospita SQL Server 2005 */
Ora mi sposto sul server di destinazione con SQL Server 2005 e da SQL Server
/***************************/
/* Istanza SQL Server 2005 */
/***************************/
/* 3) Effettuo il restore */
RESTORE DATABASE Northwind
FROM DISK = 'C:\Nwind.bak'
WITH
MOVE 'Northwind' TO 'C:\northwnd.mdf',
MOVE 'Northwind_log' TO 'C:\northwnd.ldf';
GO
Processed 376 pages for database 'Northwind', file 'Northwind' on file 1.
Processed 1 pages for database 'Northwind', file 'Northwind_log' on file 1.
*/
Come vedi nel comando RESTORE sono andato a specificare la clausola WITH
MOVE che ti permette di specificare un nuovo path dei file fisici che
costituiscono il database.
Dato che di default le due versioni di SQL Server utilizzano path differenti
per memorizzare tali files, sei costretto a specificare la clausola WITH
MOVE se non vuoi incorrere nel messaggio d'errore che hai segnalato.
Ciao!
Grazie mille!! .... tutto perfetto :)
Andrea

Loading...