The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Copy Prod DB to Dev

Discussion in 'Database Discussions' started by jrich523, Dec 21, 2014.

  1. jrich523

    jrich523 Registered

    Joined:
    Dec 21, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Right now i have a prod and dev site and I've used GIT to keep them in working order via branches, which works great for files, however with the DB its sort of a pain, what im doing right now is

    1) From CPanel go to mysql databases and drop the Dev DB
    2) go to phpmyadmin and go to the db, operation, copy DB (leaving all its settings to the defaults)
    3) go back to mysql databases and assign the user permissions.

    this seems like it would be something fairly easy to script but i've run in co a couple of problems

    1) most of the scripts assume you have the root password for mysql (i dont think i have that, HostGator shared account)
    2) mysqldump vs using SQL script, its a small DB but i've seen a good deal of opinions for both.


    and suggested methods for doing this via a script?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Try to use your cpanel user name and password in your script and test that for your work.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  4. jrich523

    jrich523 Registered

    Joined:
    Dec 21, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thanks for the responses guys.

    I was able to get most of it working but im unable to set the DB permissions due to limitations by the provider. It looks like i'll have to work some web magic to get the permissions automated. Probably something similar to the DB Backup script i've seen floating around.
     
Loading...
Similar Threads - Copy Prod Dev
  1. Buzz50
    Replies:
    1
    Views:
    358

Share This Page