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.

Making a 'dev copy' of cPanel server?

Discussion in 'General Discussion' started by SBinIN, Nov 3, 2011.

  1. SBinIN

    SBinIN Member

    Joined:
    Nov 3, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Did search first, but didn't find anything matching our situation.

    What we are trying to accomplish is create an internally managed development server that mirrors our 3rd party hosted web server, which uses cPanel. Previously, most of the content/work on the site was done by a consulting firm, but we are gearing up to do some of this work internally, with an eventual goal of doing most/all ourselves. We have (I believe) full access to the cPanel of this server, and have managed pretty much everything accessible in cPanel ourselves for quite some time (generally by enlisting support when it is something we haven't needed to do/learn previously).

    I'm a server/network guy, don't really have the web developer experience/skillset, just happen to be the one asked to build up the dev environment. Thus far I have built a server with a public address (and the DMZ to allow that), and installed CentOS/cPanel on it. It is to the point where it is prompting for activation, but I thought it might be good to have an idea if I'm on the right track before getting my 15 day trial license (time flies when you are learning as you go). For the basic setup steps I duplicated the choices present on our production (hosted) server, in hopes of providing the most consistent sandbox for those who will be using it.

    What is the best way to duplicate our existing web site onto the new server? Is it a manual process, or can it be automated/scheduled?

    Does the fqdn the box is using need to be added to the authoritive name servers for name resolution (since we don't plan to actually expose it to the outside)?

    I am pretty confident I'm in "don't know what I don't know" territory here. Am I approaching this with some obviously incorrect or incomplete assumptions?

    Any insight or assistance would be greatly appreciated. (Including, "get the trial license and have support help you," if that is the best course of action.) Thanks!
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Since this is going to be a development server, the best way to mirror would be to use rsync in that situation. I want to note that only a test server that is not production would be best suited for rsync over using the regular backups and transfer tools cPanel/WHM provides.

    If you want to use rsync, here is a guide on how to do so:

    http://forums.cpanel.net/f5/rsync-backups-160054.html#post671150
     
  3. SBinIN

    SBinIN Member

    Joined:
    Nov 3, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Due to no response as of this morning, I had proceeded to get a trial license and have been setting up the new server exactly like the production server. (Just working my way down the list in the leftmost pane, and have gotten down to Transfers section.) Feel like I have it configured identically (thus far), except of course things directly related to the Accounts. Was looking at using the "Copy an account from another server" transfer to copy over one account to test the process, and popped back in to check the forum for tips on doing that.

    For the initial setup, at least, is that method better/worse than rsync? (The "Copy an account from another server" looks much simpler than rsync, in reading through the thread you had linked me to. I do have full root access to both cPanel servers, btw.)

    Ahh, and I did want to nail down the copying of an account does not change the existing account on our production server before doing anything there. (Sounds like the case from posts 9 and 10 of http://forums.cpanel.net/f5/use-backup-move-cpanel-account-232052.html )

    Thank you!
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Copying an account to transfer it will end up taking far longer than doing an rsync, since you can simply cron periodically rsyncing the accounts, files and folders. Rsync allows you to only grab changed files since the last rsync.

    Since this is a development machine, rsync is a better method to use. You do not, though, want to change the IP files mentioned in the thread (since you want each machine to maintain its own separate IP).

    I wouldn't base the choice made on what appears easier but on what will work better for the specific scenario. In the long-run, rsync via a cron is actually easier to perform.
     
  5. SBinIN

    SBinIN Member

    Joined:
    Nov 3, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Okay, I have confirmed rsync is already installed on the server. I have physical cli, ssh, and cPanel web console access to the new/local/"dev" server, and then ssh and cPanel web console access to the old/remote hosted/production server.

    Do I need to do anything in the way of setting up the accounts or file structures in preparation, or will rsync do all that as part of the copy process?

    It looks as though (after quite a bit of reading) this is the correct syntax to enter at the local server to copy (via ssh) the account *Account-Name* from the webroot of the Production Server *Production-Server.url* to the webroot of the local server:

    rsync -r -a -v -e "ssh -l *Account-Name*" --delete *Production-Server.url*:/webroot /local/webroot

    Unless I have that totally reversed, in which case the whole "--delete" makes me pretty nervous. (Can I run this without the --delete switch? I'd like that much better, if so.)

    Just carefully feeling my way along. I really appreciate the help. Thank you!
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Why are you adding the delete command to the rsync? I'm just confused why you wouldn't simply follow the exact instructions of what to copy into /tmp/movelist file onto the development server and use the same rsync command provided in that guide.
     
  7. SBinIN

    SBinIN Member

    Joined:
    Nov 3, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I was working off the "How to use rsync for transferring files under Linux or UNIX" you'd linked to in post 30 of the rsync thread you linked to above (http://forums.cpanel.net/f5/rsync-backups-160054.html#post671150). But perhaps I was confusing two different things?

    I guess I wasn't sure how to go about populating the "movelist" file with the correct information, and the other was something I could wrap my head around (or so I thought). I really am new to this (hence posting this in the "New User Questions" subforum), sorry if I'm just slow on the uptake.

    Can you give me some insight on what to put in the makelist file? Do I need to get a directory listing from the old server and paste it into the file, or am I just drifting farther into the weeds?

    Thank you!
     
  8. SBinIN

    SBinIN Member

    Joined:
    Nov 3, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I submitted a post earlier, but it was apparently held for Moderator approval for some reason. Hoping it went/goes through.
     
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You'd simply need to copy the exact contents already in the movelist file in that post, since that will copy the main components that you need to copy over. You'd follow the guide exactly other than the IP portion mentioned, since you wouldn't want to include changing the IP parts.
     
  10. SBinIN

    SBinIN Member

    Joined:
    Nov 3, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Okay, I was able to make the movelist file, and put the list of directories in it that you specified.

    One curious thing is that I am getting repeatedly prompted for the root password, unsure if that is to be expected, and when I type it in I typically get either rsync errors, or this:

    stdin: is not a tty
    receiving incremental file list


    sent xx bytes received xxx bytes x.xx bytes/sec
    total size is xx speedup is x.xx

    Rsync errors look like this:
    rsync errors.gif

    Not sure if this is normal, and I just need to let it finish and then run it again to catch what failed the first time, or if this is an issue. Just going to keep providing the password and let it run, until I hear differently.

    Thank you!
     
  11. SBinIN

    SBinIN Member

    Joined:
    Nov 3, 2011
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Looks like everything is good, after the rsync finished. I did have to fix the license, and the passwords were changed to match those on the production server, but the accounts/domains are showing up in the list in cPanel.

    Looks like I just need to set up the web sites as subdomains of the dev server's hostname main domain, to be able to access them at different dns names than the production sites live at.

    Thanks again for all your help!
     
    #11 SBinIN, Nov 8, 2011
    Last edited: Nov 8, 2011

Share This Page