Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

web based inter environment mysql management

  • 25-06-2012 10:07pm
    #1
    Registered Users, Registered Users 2 Posts: 279 ✭✭


    I get a daily dump of my production website mysql databases.

    I'm looking for a simple way to copy them to any of my test environments using linux. I can write a bash script to do it but would really like to create a drag and drop page using PHP and drag the DBs from my production dumps to any environment of my choice. The script would need to copy and untar the DB and then run the mysql into the correct DB environment.
    mysql -u username -p database < database.sql
    

    I can do this using the exec() function (not recommended I know but will just be run locally). Unfortunately my DBs are quite big so ideally I'd like some copying progress information returned to the php page similar to a black box showing the live output of the terminal.

    I can't think of any way of doing this.

    Is anything like this even possible? Any already existing software?

    Anyone any help?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 45 irishd


    To be honest, I'd do most of it using bash scripts rather than passing large amounts of data through PHP - there are too many things that can go wrong with web initiated processes.

    You could have a PHP based page as a "director" that writes instructions to a temp file, then have a cron job running every minute waiting for something to do. This way, the PHP page can easily monitor the status of any running jobs without actually doing any heavy lifting itself.

    On the servers, use SSH and/or SCP with certs to be able to seamlessly copy & execute instructions between machines.


Advertisement