SQLTeam.com | Weblogs | Forums

Clone database from one PC to Other PC


#1

Hello,

How do I clone my current database in SQL Express in PC 1 to my other new SQL express in my PC 2?

Thank you


#2

use BACKUP & RESTORE

  1. Backup the database
  2. transfer the backup file to PC2
  3. Restore it

#3

Take the backup to the same machine and copy it to another machine and do restore

To take backup

USE DATABASE_NAME;
GO
BACKUP DATABASE DATABASE_NAME
TO DISK = 'D:\DATABASE_NAME.Bak'
   WITH FORMAT, MEDIANAME = 'D_SQLServerBackups',
   NAME = 'Full Backup of DATABASE_NAME';
GO

To restore backup

RESTORE FILELISTONLY
FROM DISK = 'D:BackUpYourBaackUpFile.bak'
GO

#4

Thank you guys! Appreciated for all your help and time!