TKLBAM Restore and MySql views

Pionium's picture

Lamp Stack - MySQL - TKLBAM

Hi there, I'd like to start with an apology. I'm sorry for being late to the party! I've only just discovered TurnKey, and I am so excited and impressed with it. What a great product.

Now for my problem: I have just started a new piece of development, and I wanted to transfer the work from one development host to another, so I ran a backup on the source appliance, and then performed a restore on the target.

All looked fine, everything I expected transferred across... EXCEPT the database view. Tables, Routines and data all transferred perfectly, but the views (the one and only view) did not. Is there a known issue with this, or have I done something wrong?

Thanks in advance


Liraz Siri's picture

Thanks for reporting this. I admit I didn't take database views into account in my testing so this might be a bug. I have a round of development scheduled for tklbam so hopefully I'll take a look at this soon. In the meantime as a workaround you could add a TKLBAM hook (see /etc/tklbam/hooks) that creates the missing view following a restore.
Pionium's picture

Thank you for your advice on this. I will look into putting a hook in place to backup and restore the missing view.

In my case it is not too critical, since it is currently only a single view, but as my development progresses, there will be more.

Once again, thanks for your help


Logan Chase's picture

i have the same problem. did you manage to solve it? i have lots of views and they not being backed up or restored.

how do you write a hook to save and restore mysql views? the example hook isnt very helpful.


Pionium's picture

Hi Logan,

No, I haven't solved this yet. I tried a couple of times unsuccessfully to create pre-backup and post-restore hooks to transfer the view across, but it didn't work.

Since I only have a single view, I didn't worry about it, as I can easily recreate it after the restore. Hopefully this bug will be fixed when I have more views.

Since you have more views, perhaps you will have more success in your investigations. Good luck. If you do find the solution, then please let me know.

All the best


Marko's picture

Any progress with views backup?

Liraz Siri's picture

Still on my todo list. Should be getting back to TKLBAM development real soon now.

Liraz Siri's picture

Support for MySQL views and triggers support was added to TKLBAM 1.3:

Thanks to Pionium, Logan and Marko for reporting this.

Post new comment