Adapting Diagram File to Another Database
Some of our users have faced the situation when they need to change the connection details of the existing Database Diagram file.
Let’s assume the situation when you have several databases with identical schemas which are only located on different MySQL servers and you have created a database model that was saved in a Database Diagram file. Now, you want to avoid redesigning the database model from scratch and only reassign the existing database model to another MySQL server.
Here are some steps you can follow to achieve this:
1. Create a database diagram.
2. Arrange objects on the diagram so you can easily read them (create containers, notes, etc).
3. Save the diagram and close dbForge Studio for MySQL.
4. Open the Database Diagram file using a third-party text editor, for instance, notepad.
5. Find the <Connection></Connection> tag that may look as follows:
... <Connection> <Name>MyConnectionToDB</Name> <ConnectionString> User Id=root;Host=db;Port=3310;Database=sakila;Ping Interval=120;Character Set=utf8; </ConnectionString> </Connection> ...
and make the following changes:
... <Connection> <Name>new_connection_name</Name> <ConnectionString> User Id=new_user_id;Host=new_host;Port=new_port;Database=new_db_name; Ping Interval=120;Character Set=utf8; </ConnectionString> </Connection> ...
i.e. modify the <Name></Name> tag (change it to something different) and the <ConnectionString></ConnectionString> tag (connection details for another server).
6. Find all the <DbOid></DbOid> tags that may look as follows:
... <DbOid> <Path>sakila.actor</Path> <TypeName>Table</TypeName> </DbOid> ...
and change the database name to the new one:
... <DbOid> <Path>new_db_name.actor</Path> <TypeName>Table</TypeName> </DbOid> ...
Make sure you specify the new database name in the same letter case as it exists on the server.
7. Save the modified file with the new name.
Now, you have a new Database Diagram file adjusted to another server.
NOTE: The article applies to dbForge Studio for MySQL, dbForge Studio for SQL Server, and dbForge Studio for Oracle.
- Get the New Update of SQL Tools With Support for SSMS 19 - July 20, 2022
- Getting Started With dbForge Source Control - July 18, 2022
- Oracle Tablespace – an Overview of Types and Basic Manipulations - July 7, 2022
December 26th, 2018 at 12:21 am
After I changed my file using these recommendations, I’m getting an error: ‘ Diagram deserialization failed’. XML is valid. How can I check what’s wrong?
December 26th, 2018 at 12:34 am
Hi! After I changed my file accordingly those recommendations, I’m getting an error: ‘Diagram deserialization failed’. XML is valid. How can I check what’s wrong?
February 19th, 2019 at 6:44 pm
Hello,
Could you please tell us what product you use, product edition, and product full version.
Looking forward to your reply.