A scripts folder is a set of scripts that represent a database schema and optionally can include data. An object creation script file is generated for each object. These script files can be organized in user-defined subfolders based on object types. They can be utilized for:
A scripts folder stores the following information:
Note
dbForge Schema Compare can compare scripts folders with different structures, allowing for scenarios where objects are either organized in separate folders or generated within a single .sql file. It should be noted that scripts folders can be created using the dbForge tool or any third-party tool. However, when synchronizing data, dbForge Schema Compare will write objects according to the folder structure specified in the dbForge tool.
dbForge Schema Compare supports creating a scripts folder in the Create Scripts Folder dialog or in the New Schema Comparison wizard when comparing and synchronizing scripts folders.
1. On the ribbon, select Database > Create Scripts Folder to open the Create Scripts Folder dialog.
2. Under Source, choose a database as a source type, a server connection, and a database from which you want to create a scripts folder.
3. Under Destination, choose a scripts folder as a destination type and specify a path to the output file name to store the scripts folder.
Note
The default path to the output file to store the scripts folder is C:\Users\Username\Documents\Devart\dbForge Schema Compare for MySQL\scriptFolder. To change the path, click
Browse, specify the folder, and click Select Folder.
4. Optional: Click Scripts Folder Structure to customize the scripts folder structure and file name templates. In the window that opens, all object types are selected by default. Clear the checkbox next to the type you want to exclude from the scripts folder structure. To save the changes, click OK.
5. Click Create to create a scripts folder. The notification popup window will display, informing you that the scripts folder has been created. Click OK to close the window.
When comparing and synchronizing scripts folders as a Target or a Source, a synchronization script is created. You can save it to a file or open it in an internal editor.
When a scripts folder is selected as the Source, you can execute the synchronization script directly against the target database or generate a migration script.
When a scripts folder is selected as the Target, you can update the scripts folder after synchronization or generate a migration script.
Note
When you need to compare data in a scripts folder, refer to Compare and synchronize scripts folders and static data.
1. On the standard toolbar, click New Schema Comparison to open the New Schema Comparison wizard.
2. On the Source and Target page of the wizard, choose a scripts folder as a source type and a database as a target type.
3. Under Source:
4. Under Target:
5. Optional: On the Options page, you can customize the default behavior of the schema comparison process by selecting additional options.
6. Click Compare to run the comparison process. The Schema Comparison progress window opens, showing the stages of the comparison process.
7. In the Schema Comparison document that opens, all objects for schema synchronization are selected by default. To exclude the objects from synchronization, clear the checkboxes next to the corresponding objects and click Synchronize data to the target database to open the Schema Synchronization Wizard.
8. On the Output page of the wizard, select Execute the script directly against the target database and click Synchronize to synchronize the scripts folder with the database.
1. On the standard toolbar, click New Schema Comparison to open the New Schema Comparison wizard.
2. On the Source and Target page of the wizard, choose a database as a source type and a scripts folder as a target type.
3. Under Source:
4. Under Target:
5. Optional: On the Options page, you can select additional options to customize the default comparison process.
6. Click Compare to run the comparison process. The Schema Comparison progress window opens, showing the stages of the comparison process.
8. In the Schema Comparison document that opens, all objects for schema synchronization are selected by default. To exclude the objects from synchronization, clear the checkboxes next to the corresponding objects and click Synchronize data to the target database to open the Schema Synchronization Wizard.
9. On the Output page of the wizard, select Update the scripts folder and click Synchronize to synchronize the database with the scripts folder.
Certificates, symmetric keys, and asymmetric keys are not supported when you use a scripts folder as a data source.
When you select a scripts folder as a target data source, comments that are part of a table definition will be lost when the table is modified and the object creation script updated.
You can use the scripts folder comparison feature to copy or transfer database data. To move data, it’s required to utilize the scripts folder feature provided by dbForge Data Compare. To learn how to do it, see Compare and synchronize scripts folders and static data.
We recommend you select the Ignore spaces in object names and Ignore white spaces options on the Options page when you use a scripts folder as a data source to avoid any issues for objects such as views, stored procedures and functions, triggers, user types, defaults, and rules.
Note
To ensure scalability and reliable backups, you can use Microsoft Azure Files and/or Microsoft OneDrive as storage for your scripts folders.