Dave's picture

Hey Guys,

To put it simple, i f#cked up a sql database.

On the server are 2 websites, those are back'd up with TKLBAM.

Now, i just want 1 sql database restored, i have read the manual but am not sure what to use in webmin so that ONLY the database will get restored and not all the rest.

Very important, becasue there is a life webshop on the server that can not go down !

now i read this : LIMIT := -?(/path/to/include/or/exclude | mysql:database[/table])

If i have database ''website1'' and ''website2'' and want only SQL database of ''website2'' restored and nothing else, what is the exact line i put in the limts box on page '' Configure Restore -- Backup #2, TurnKey Magento 12200.88 MB ''

Thanks so much for helping,

If this will not work i lost days of work...

Jeremy Davis's picture

According to the tklbam-restore man page it would be something like this:
tklbam-restore --skip-files --skip-database --skip-packages --limits="mysql:database/website2"
However the man page also notes that you can see what will happen by using the "--simulate" switch too; so:
tklbam-restore --simulate --skip-files --skip-database --skip-packages --limits="mysql:database/website2"
Also FWIW there is also the tklbam-restroe-rollback command if need be...

But even then; personally if this is a live production server and there is risk of something being badly broken I would test first! I would never risk running something that you don't (for 100% sure) know will happen on a live production server! Whilst I would always hope (and even expect) that TKLBAM (and TurnKey in general; in fact all software in general) would/should work as intended I personally wouldn't trust it without testing it.

Hope for the best but plan for the worst!

And considering that you can really easily launch a new server via the Hub (or download and install to a local VM if you'd prefer) IMO there isn't really an excuse to not test first...!

Good luck with it all and let us know how you go! :)

Dave's picture

What i did, hope this may help someone in the future...

First i took a raw backup to the server
tklbam-restore 2 --raw-download=/var/www/tmp/name_of_backup_here_from_tklbam

After that i isolated the backup to a new folder on the server in  /var/www/tmp  and named a folder ''backup''

In that ''backup'' folder is only backd'up folder ''TKLBAM'' and in that folder look for ''myfs''. There i only copied the desired database folder incl. the init file.

Then trough SSH i used this command, it went well but i noticed it also putted back all other folders on my life website, so it does not work all as planned, allthough it are just files so maybe i forgot something to add to this line ?

tklbam-restore /var/www/tmp/backup --limits=mysql:database_name

This resulted that i have my database back like before the crash.

Maybe someone can add something to this line so that only the database will be put back.

Thanks , cheers !

Jeremy Davis's picture

Like I suggested above; I reckon you need to '--skip-files'...

Add new comment