SQL Server Database Full migration

Source: Internet
Author: User
Tags add copy empty sql access backup
server| Data | database
Method One:
1. Stop the source database, copy the database two physical files (MDF, LOG) to the destination.
2. Open the Enterprise Manager of the destination SQL Server database and attach the database file as a local database. However, the library name should be modified to a different name, such as Xxbak.
3. Create a new empty library with the same name as the source database and use the default value.
4, in "Security"-"login" to create the actual login of the database, enter access password, "database access" in the corresponding database, and tick the "db_owner" option.
Because the login name for the library cannot be modified until the database is attached, the login name corresponding to it is often empty so that the table in the database cannot be accessed.
5, from the additional backup database to export data to the new empty database:
After you select the source and destination data sources, it is important that you next select "Replicate objects and data between SQL Server Databases", and do not select the default "Copy tables and views from the source database", which will not replicate the data.

___________________________________________________________________
Method Two:
1, in SQL Server Enterprise Manager, select the database to transfer, press the right mouse button, select All Tasks-> backup database.
Backup Select Database-Complete,
Purpose--back to--press the Add button
FileName--Enter a custom backup database file name on the SQL Server server hard disk (suffix is generally bak)
overriding--Selecting overwrite existing media
Finally press the OK button.
If the generated backup database file is larger than 1M, compress the compression tool and then transfer to the Internet.

2. Purpose SQL Server database if you do not have this database, create a new database first;
Then select the newly created database, press the right mouse button, select All Tasks-> Restore the database
Restore-> from Device-> Select device-> disk-> Add (find backup database file name to import)-> determine
Restore backup Set-> database-complete
Finally press the OK button. The full database import succeeded.
(If you are restoring a database on an existing SQL Server database, you may be experiencing a failure to recover by someone else is using it, you can go to see-> management-> the current active-> lock/Object-> Find the process number for the lock in the database-> Kill the lock with the kill process number in the Query Analyzer, and then do the restore.

3. This restored database data should be complete, but user name access may not be normal


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.