How to copy database structures
Last modified: July 4, 2024
With Schema Compare, you can duplicate the architecture and design of an existing database and replicate it in a completely new database. This process involves comparing the schemas of two databases, identifying the differences in structure, and then applying these changes to the target database.
To copy the structure of a database:
1. Create a new database in dbForge Studio for SQL Server using Database Editor.
Note
Alternatively, you can create a database while selecting Source and Target for comparison.
2. Open dbForge Schema Compare and click New Schema Comparison.
3. In the New Schema Comparison wizard that opens, select the existing database, scripts folder, backup, or snapshot as a Source and the newly created database as a Target.
4. Configure the comparison options.
5. Configure the mapping.
6. Since you have selected an empty database as a Target, there will be no tables to map. Click Compare.
7. In the comparison results, select the database objects you would like to copy.
8. Click Synchronize objects to the target database .
9. In the Schema Synchronization Wizard that opens, select the output options to manage the generated synchronization script:
- Open the synchronization script in the internal editor — the script for database synchronization will be opened in the internal editor of the Schema Compare tool. You will be able to execute it by clicking Execute on the toolbar menu.
- Save the script to a file — the script will be saved locally on your PC. If you would like to open the script in the internal editor after saving, click to select the checkbox next to this option.
- Execute the script directly against the target database — the script will be executed immediately without allowing you to review it.
10. Configure the synchronization options.
11. If needed, type or select the script to be executed before and/or after the schema synchronization.
12. Review the synchronization actions and warnings. If anything needs to be adjusted, click Back and change the corresponding settings.
13. Click Synchronize.
14. Once the synchronization script is ready, review it and click Execute.
15. Go back to the comparison results and click Refresh. Now, the Source database structure has been copied, and there is nothing to synchronize anymore.
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by Schema Compare for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.