Problem during the restore file

Sep 17, 2015 at 10:20 PM
Hello,
I have a problem during the restore.
There are some views that recall other views.
Of course it may happen that the views mentioned have not yet been created by the restore process. For this reason, the restore process does not go to fruition.

example:
DROP VIEW IF EXISTS MyView1;
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW MyView1 AS select Column1,column2 from MyView2;

DROP VIEW IF EXISTS MyView2;
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW MyView2 AS select Column1,column2 from MyTable;

The return error message is : Table 'MyDatabase.MyView2' doesn't exist

Someone can help me? Thank you.

P.s.
Sorry for my bad english.
Coordinator
Sep 18, 2015 at 11:49 AM
Currently, you can do it manually.

SQL command to show all VIEWs
SHOW FULL TABLES FROM `database1` WHERE Table_type = 'VIEW';
SQL command to how to create the VIEWs
SHOW CREATE VIEW `MyView1`;
Manually write the CREATE VIEW into a text file.
Then, restore with that text file.
Sep 21, 2015 at 6:09 PM
Excuse me, but maybe I did not make myself clear last time.
The restore procedure works well but is stopped when it attempts to create the MYVIEW1 because inside there is the call to MyView2.
The MyView2 at that time not yet created then triggered the error.
The dump file is about 300 MB and I want to automate the process.
Doing it manually is not for me a right path.
Is there another solution for this issue?
Thank you and sorry for my bad english.
Coordinator
Sep 22, 2015 at 4:05 AM
I am unable to figure out the correct sequence of the creation of VIEW which depend on each other.

You can export everything except the VIEW by using the automate process of MySqlBackup.NET.
Yes, a dump content without VIEW.

The CREATE statement of VIEW has to be created by you, this is because only you will know the sequence of creating them.

After you have created the VIEW dump file, you can use MySqlBackup.NET to import the VIEW dump file.
Sep 28, 2015 at 6:12 PM
Ok Thanks.