Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

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
Advertisement