How to copy database structures

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.

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.

Choose source and target

4. Configure the comparison options.

Comparison options

5. Configure the mapping.

Schema mapping

6. Since you have selected an empty database as a Target, there will be no tables to map. Click Compare.

Table mapping

7. In the comparison results, select the database objects you would like to copy.

Select the existing schema

8. Click Synchronize objects to the target database Sync button.

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.

Synchronization Wizard - Output

10. Configure the synchronization options.

Synchronization Wizard - Options

11. If needed, type or select the script to be executed before and/or after the schema synchronization.

Synchronization Wizard - Additional Scripts

12. Review the synchronization actions and warnings. If anything needs to be adjusted, click Back and change the corresponding settings.

13. Click Synchronize.

Synchronization Wizard - Summary

14. Once the synchronization script is ready, review it and click Execute.

Synchronization script

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.

Schemas sSynchronized

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Schema Compare for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Schema Compare in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Schema Compare for your business, request a demo to see it in action.
Ready to start using dbForge Schema Compare for SQL Server?